From 36c0a90fb86c63dd24d1c90a5cc28de099dbb3a4 Mon Sep 17 00:00:00 2001 From: spwoodcock Date: Thu, 12 Dec 2024 00:39:23 +0000 Subject: [PATCH] build: replace NODE_ENV with pnpm xxx --prod --- docker-compose.development.yml | 1 - docker-compose.main.yml | 1 - src/Dockerfile.ui.debug | 1 - src/Dockerfile.ui.prod | 12 +++++------- 4 files changed, 5 insertions(+), 10 deletions(-) diff --git a/docker-compose.development.yml b/docker-compose.development.yml index 467f95f8d0..5035e31b97 100644 --- a/docker-compose.development.yml +++ b/docker-compose.development.yml @@ -123,7 +123,6 @@ services: APP_VERSION: ${GIT_BRANCH} VITE_API_URL: https://${FMTM_API_DOMAIN:-api.${FMTM_DOMAIN}} VITE_SYNC_URL: https://${FMTM_SYNC_DOMAIN:-sync.${FMTM_DOMAIN}} - NODE_ENV: development volumes: - fmtm_frontend:/frontend network_mode: none diff --git a/docker-compose.main.yml b/docker-compose.main.yml index da8683b784..475f9f88b0 100644 --- a/docker-compose.main.yml +++ b/docker-compose.main.yml @@ -113,7 +113,6 @@ services: APP_VERSION: main VITE_API_URL: https://${FMTM_API_DOMAIN:-api.${FMTM_DOMAIN}} VITE_SYNC_URL: https://${FMTM_SYNC_DOMAIN:-sync.${FMTM_DOMAIN}} - NODE_ENV: production volumes: - fmtm_frontend:/frontend network_mode: none diff --git a/src/Dockerfile.ui.debug b/src/Dockerfile.ui.debug index 9510364990..c01d3698ae 100755 --- a/src/Dockerfile.ui.debug +++ b/src/Dockerfile.ui.debug @@ -11,5 +11,4 @@ ENV PNPM_HOME="/pnpm" ENV PATH="$PNPM_HOME:$PATH" RUN corepack enable && corepack use pnpm@9.3.0 RUN pnpm install -ENV NODE_ENV development ENTRYPOINT ["pnpm", "run", "dev"] diff --git a/src/Dockerfile.ui.prod b/src/Dockerfile.ui.prod index 70bf2db8bb..3b33b380b0 100644 --- a/src/Dockerfile.ui.prod +++ b/src/Dockerfile.ui.prod @@ -1,10 +1,8 @@ -FROM docker.io/node:20 AS base -ARG NODE_ENV +FROM docker.io/node:20-slim AS base ARG VITE_API_URL ARG VITE_SYNC_URL ENV VITE_API_URL=${VITE_API_URL} \ VITE_SYNC_URL=${VITE_SYNC_URL} \ - NODE_ENV=${NODE_ENV} \ PNPM_HOME="/pnpm" \ PATH="$PATH:/pnpm" RUN corepack enable && corepack use pnpm@9.3.0 @@ -13,16 +11,16 @@ WORKDIR /app FROM base AS manager-frontend COPY frontend/package.json frontend/pnpm-lock.yaml ./ -RUN pnpm install +RUN pnpm fetch --prod COPY frontend/ . -RUN pnpm run build --mode ${NODE_ENV} +RUN pnpm run build FROM base AS mapper-frontend COPY mapper/package.json mapper/pnpm-lock.yaml ./ -RUN pnpm install +RUN pnpm fetch --prod COPY mapper/ . -RUN pnpm run build --mode ${NODE_ENV} +RUN pnpm run build FROM docker.io/rclone/rclone:1 AS prod