Files
finance/infra/docker/Dockerfile.frontend
T
k1nq c85b12b95e
CI / detect (push) Successful in 2s
CI / Compose & nginx validation (push) Failing after 4s
CI / Frontend (lint / type / test / build) (push) Failing after 19s
CI / Backend (lint / type / test / build) (push) Failing after 47s
Refactor Docker configurations for frontend and Celery worker
- Updated the Celery worker command in docker-compose.yml to remove unnecessary flags for improved performance.
- Modified the frontend Dockerfile to use pnpm instead of corepack for package management and included pnpm-workspace.yaml in the build context.
- Adjusted the Dockerfile to correctly copy the nginx configuration from the build stage.
- Added network and build arguments for HTTP proxies in the docker-compose.yml for better network handling.
2026-09-18 15:23:18 +05:00

34 lines
1.1 KiB
Docker

# Provider-neutral production image for the frontend: static SPA build served
# by nginx, which also reverse-proxies /api/v1 to the API (same origin).
#
# Build contract (owned with the frontend team, see infra/README.md):
# - build context is frontend/ and must contain package.json, pnpm-lock.yaml
# - `pnpm build` emits the production bundle to frontend/dist
# - the named context "infra" must point at infra/ (Compose sets it; CLI
# builds pass --build-context infra=./infra)
#
# Build:
# docker build -f infra/docker/Dockerfile.frontend \
# --build-context infra=./infra -t finance-frontend:local frontend
FROM node:22-alpine AS build
WORKDIR /app
RUN npm install --global pnpm@12.4.1
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
RUN pnpm install --frozen-lockfile
COPY . .
RUN pnpm build
FROM nginx:1.27-alpine AS runtime
COPY --from=infra nginx/nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=build /app/dist /usr/share/nginx/html
EXPOSE 80
HEALTHCHECK --interval=10s --timeout=3s --start-period=5s --retries=12 \
CMD wget -q --spider http://127.0.0.1/ || exit 1