21 lines
649 B
Docker
21 lines
649 B
Docker
# ---------- Build stage ----------
|
|
FROM node:22-bullseye-slim AS build
|
|
WORKDIR /app
|
|
|
|
# Install dependencies first (better layer caching)
|
|
COPY package.json package-lock.json ./
|
|
COPY apps/web/package.json apps/web/package.json
|
|
# Avoid optional native optional deps that fail on some builder environments
|
|
RUN npm ci --no-optional
|
|
|
|
# Copy source and build the static site
|
|
COPY apps/web apps/web
|
|
RUN npm run build --workspace apps/web
|
|
|
|
# ---------- Production stage ----------
|
|
FROM nginx:stable-alpine
|
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
|
COPY --from=build /app/dist/apps/web /usr/share/nginx/html
|
|
EXPOSE 80
|
|
CMD ["nginx", "-g", "daemon off;"]
|