CRA-Helper/docker/web.Dockerfile
sylvain p a891b56360 Add Docker stack for self-hosted deployment
Brings full Postgres + api + web compose setup so the app can run on any
machine with just Docker, instead of requiring a host PostgreSQL install.
Includes a one-shot migrate service that pushes the Drizzle schema before
the API starts. Web image serves the Vite build via nginx and proxies
/api/* to the api-server.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-07 12:11:36 +02:00

32 lines
1.0 KiB
Docker

# syntax=docker/dockerfile:1.7
FROM node:24-slim AS base
RUN npm install -g pnpm@10
WORKDIR /repo
FROM base AS deps
COPY .npmrc package.json pnpm-lock.yaml pnpm-workspace.yaml tsconfig.base.json tsconfig.json ./
COPY artifacts/api-server/package.json artifacts/api-server/
COPY artifacts/cra-app/package.json artifacts/cra-app/
COPY artifacts/mockup-sandbox/package.json artifacts/mockup-sandbox/
COPY lib/api-client-react/package.json lib/api-client-react/
COPY lib/api-spec/package.json lib/api-spec/
COPY lib/api-zod/package.json lib/api-zod/
COPY lib/db/package.json lib/db/
COPY scripts/package.json scripts/
RUN pnpm install --frozen-lockfile
FROM deps AS build
COPY lib lib
COPY artifacts/cra-app artifacts/cra-app
COPY attached_assets attached_assets
ENV NODE_ENV=production
ENV PORT=80
ENV BASE_PATH=/
RUN pnpm --filter @workspace/cra-app run build
FROM nginx:alpine AS runtime
COPY docker/nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=build /repo/artifacts/cra-app/dist/public /usr/share/nginx/html
EXPOSE 80