Files
2026-04-23 00:21:02 -04:00

33 lines
886 B
Docker

FROM node:20-bookworm-slim AS builder
WORKDIR /app
# If npm/yarn fail with "unable to get local issuer certificate" during install, build with:
# docker compose build --build-arg NPM_STRICT_SSL=false client-prod
# (Only use on trusted networks; prefer mounting your org CA via NODE_EXTRA_CA_CERTS instead.)
ARG NPM_STRICT_SSL=true
RUN if [ "$NPM_STRICT_SSL" = "false" ]; then npm config set strict-ssl false; fi
COPY package.json package-lock.json ./
ENV CI=true \
npm_config_maxsockets=1 \
NPM_CONFIG_LEGACY_PEER_DEPS=true
# Mitigate npm "Exit handler never called!" in some Docker/npm builds (see npm/cli issues).
RUN npm install --no-audit --no-fund
COPY . .
ARG VITE_API_ORIGIN=
ENV VITE_API_ORIGIN=$VITE_API_ORIGIN
RUN npm run build
FROM nginx:alpine
COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=builder /app/dist /usr/share/nginx/html
EXPOSE 80