Files
root c6d2bc007e
Web Client CI/CD / Lint (ESLint + TypeScript) (push) Successful in 40s
Web Client CI/CD / Build (tsc + Vite) (push) Successful in 24s
Web Client CI/CD / Deploy to shared hosting (push) Successful in 33s
fix first production issues
2026-07-10 03:43:47 -04:00

33 lines
877 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_URL=
ENV VITE_API_URL=$VITE_API_URL
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