diff --git a/Dockerfile b/Dockerfile index 8bfdc6f..58dc8b6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,9 +10,6 @@ COPY package*.json ./ # Install application dependencies RUN npm install -# If you're building your code for production -# RUN npm ci --only=production - # Copy prisma schema COPY prisma ./prisma/ @@ -32,8 +29,10 @@ EXPOSE 80 ENV DATABASE_URL=mysql://root:BEVLqLReqUyA@srv-captain--nq-db:3306/new-quest # Create a shell script to run migrations and start the application -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 +RUN echo '#!/bin/sh' > /usr/src/app/start.sh && \ + echo 'npx prisma migrate deploy' >> /usr/src/app/start.sh && \ + echo 'node dist/server.js' >> /usr/src/app/start.sh && \ + chmod +x /usr/src/app/start.sh # Use the shell script as the entry point CMD ["/usr/src/app/start.sh"] \ No newline at end of file