From a71bef2161c9557189bd2be1af4caff3f1d7b526 Mon Sep 17 00:00:00 2001 From: Emnaghz Date: Fri, 27 Sep 2024 23:57:15 +0100 Subject: [PATCH] fix: add few changes --- api/Dockerfile | 32 ++++++++++++++++---------------- docker/docker-compose.dev.yml | 1 - 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/api/Dockerfile b/api/Dockerfile index a8a9f544..ba71e9f5 100644 --- a/api/Dockerfile +++ b/api/Dockerfile @@ -15,6 +15,22 @@ RUN npm i --verbose --maxsockets 6 RUN npm run build +FROM node:18-alpine AS development + +WORKDIR /app + +COPY --from=builder /app/package*.json ./ +COPY --from=builder /app/ . + +ENV NODE_ENV=development + +RUN npm install + +EXPOSE 3000 + +CMD ["npm", "run", "start:debug"] + + FROM node:18-alpine AS production WORKDIR /app @@ -31,19 +47,3 @@ RUN npm prune --production EXPOSE 3000 CMD ["npm", "run", "start:prod"] - - -FROM node:18-alpine AS development - -WORKDIR /app - -COPY --from=builder /app/package*.json ./ -COPY --from=builder /app/ . - -ENV NODE_ENV=development - -RUN npm install - -EXPOSE 3000 - -CMD ["npm", "run", "start:dev"] diff --git a/docker/docker-compose.dev.yml b/docker/docker-compose.dev.yml index e577e8b8..a2940042 100644 --- a/docker/docker-compose.dev.yml +++ b/docker/docker-compose.dev.yml @@ -22,7 +22,6 @@ services: - ../api/src:/app/src - ../api/migrations:/app/migrations #- ../api/node_modules:/app/node_modules - command: ["npm", "run", "start:debug"] mongo-express: container_name: mongoUi