From 218ac385dd96bf97237e26bdb4b8e4a20b683ed6 Mon Sep 17 00:00:00 2001 From: Dennis Postma Date: Thu, 11 Jul 2024 19:56:26 +0200 Subject: [PATCH] possible deploy fix --- Dockerfile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index f1c6c24..60f59e2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,23 +10,24 @@ COPY package*.json ./ # Install application dependencies RUN npm install +# Copy the rest of your application code to the container +COPY . . + # Copy prisma schema COPY prisma ./prisma/ # Generate Prisma client RUN npx prisma generate -# Copy the rest of your application code to the container -COPY . . - # Build the application RUN npm run build # Expose the port your Node.js application will listen on EXPOSE 80 -# Create a shell script to run migrations and start the application +# Create a shell script to run migrations, regenerate Prisma client, and start the application RUN echo '#!/bin/sh' > /usr/src/app/start.sh && \ + echo 'npx prisma generate' >> /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