1
0
forked from noxious/server
This commit is contained in:
Dennis Postma 2024-07-10 22:18:33 +02:00
parent 7e36f17053
commit 84421cbe92

View File

@ -13,6 +13,12 @@ RUN npm install
# If you're building your code for production # If you're building your code for production
# RUN npm ci --only=production # RUN npm ci --only=production
# Copy prisma schema
COPY prisma ./prisma/
# Generate Prisma client
RUN npx prisma generate
# Copy the rest of your application code to the container # Copy the rest of your application code to the container
COPY . . COPY . .
@ -25,5 +31,9 @@ EXPOSE 80
# Set environment variables # Set environment variables
ENV DATABASE_URL=mysql://root:BEVLqLReqUyA@srv-captain--nq-db:3306/new-quest ENV DATABASE_URL=mysql://root:BEVLqLReqUyA@srv-captain--nq-db:3306/new-quest
# Use node to run the application # Create a shell script to run migrations and start the application
CMD ["node", "dist/server.js"] RUN echo '#!/bin/sh\nnpx prisma migrate deploy\nnode dist/server.js' > /usr/src/app/start.sh
RUN chmod +x /usr/src/app/start.sh
# Use the shell script as the entry point
CMD ["/usr/src/app/start.sh"]