Files
gold_land_user/Dockerfile
T
safavimohadeseh78andCursor 653f1b0c5a feat(docker): add nginx frontend image and full-stack compose
Build static assets with Vite, proxy /api to backend, and document server env vars.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-06 10:13:43 +02:00

27 lines
489 B
Docker

# syntax=docker/dockerfile:1
FROM node:22.12.0-bookworm-slim AS builder
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci
COPY . .
# Baked in at build time. Default keeps browser requests on /api (nginx proxy).
ARG VITE_API_URL=/api
ENV VITE_API_URL=${VITE_API_URL}
RUN npm run build
FROM nginx:1.27-alpine AS production
COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=builder /app/dist /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]