Files

22 lines
655 B
Docker

# Frontend — build the Vite app, then serve it with nginx.
# Build context must be the REPO ROOT (npm workspaces).
FROM node:22-alpine AS build
WORKDIR /app
# Install workspace dependencies first for better layer caching.
COPY package.json package-lock.json ./
COPY apps/web/package.json ./apps/web/package.json
RUN npm ci --workspace apps/web
# Build the static site (outputs to /app/dist/apps/web).
COPY apps/web ./apps/web
WORKDIR /app/apps/web
RUN npm run build
FROM nginx:1.27-alpine
COPY --from=build /app/dist/apps/web /usr/share/nginx/html
COPY apps/web/nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]