22 lines
666 B
Docker
22 lines
666 B
Docker
# ---- Build stage ----
|
|
# Use Debian-based Node to avoid musl/native optional dependency issues
|
|
# (rollup optional native binaries may be missing for musl/alpine)
|
|
FROM node:22-bullseye-slim AS build
|
|
WORKDIR /app
|
|
|
|
# Install dependencies first so Docker can cache this layer
|
|
COPY package.json package-lock.json ./
|
|
COPY apps/web/package.json apps/web/package.json
|
|
RUN npm ci
|
|
|
|
# Copy the app source and build it
|
|
COPY apps/web apps/web
|
|
RUN npm run build --prefix apps/web
|
|
|
|
# ---- Serve stage ----
|
|
FROM nginx:1.27-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;"]
|