From ea5164bb20bd942848d4dc7f656025cc88d9d14f Mon Sep 17 00:00:00 2001 From: victorjourne Date: Tue, 24 Oct 2023 16:40:58 +0200 Subject: [PATCH] Build prod docker image --- docker-compose-frontend-build.yml | 2 +- frontend/Dockerfile | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docker-compose-frontend-build.yml b/docker-compose-frontend-build.yml index 287881b6..45432fef 100644 --- a/docker-compose-frontend-build.yml +++ b/docker-compose-frontend-build.yml @@ -4,7 +4,7 @@ services: build: context: ${FRONTEND} dockerfile: Dockerfile - target: build + target: prod args: http_proxy: ${http_proxy} https_proxy: ${https_proxy} diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 63ffad00..17ebb730 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -44,6 +44,7 @@ CMD [ "npm", "run","dev" ] # Step 3: "build" target # ################################ FROM base as build +RUN npm run build CMD ["npm", "run", "build"] #CMD ["npx", "sapper", "export"] ################################ @@ -57,6 +58,6 @@ USER node:node WORKDIR /app COPY --from=build --chown=node:node /app/__sapper__/build ./build COPY --from=build --chown=node:node /app/node_modules ./node_modules -COPY --from=build --chown=node:node /app/ViewerJS ./ViewerJS +COPY --from=base --chown=node:node /app/ViewerJS ./ViewerJS COPY --chown=node:node package.json . CMD ["node","build"] \ No newline at end of file