2026-05-21 12:32:55 -04:00
|
|
|
# Stage 1: build CSS bundle
|
|
|
|
|
FROM node:20-alpine AS css-build
|
|
|
|
|
WORKDIR /build
|
|
|
|
|
|
|
|
|
|
# Copy only the files needed to install deps (better cache layering)
|
|
|
|
|
COPY package.json package-lock.json* ./
|
|
|
|
|
RUN npm install --no-audit --no-fund
|
|
|
|
|
|
|
|
|
|
# Copy source CSS + tailwind config + every HTML file (tailwind scans HTML to determine which utilities to emit)
|
|
|
|
|
COPY tailwind.config.js postcss.config.js ./
|
|
|
|
|
COPY src/ ./src/
|
|
|
|
|
COPY public/ ./public/
|
|
|
|
|
|
|
|
|
|
# Build into public/dist/app.css
|
2026-05-21 12:41:55 -04:00
|
|
|
RUN npx postcss ./src/css/app.css -o ./public/dist/app.css --env production
|
2026-05-21 12:32:55 -04:00
|
|
|
|
|
|
|
|
# Stage 2: runtime
|
2026-04-07 21:58:21 -04:00
|
|
|
FROM nginx:alpine
|
2026-05-21 12:32:55 -04:00
|
|
|
COPY --from=css-build /build/public/ /usr/share/nginx/html/
|
2026-04-07 21:58:21 -04:00
|
|
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
|
|
|
|
EXPOSE 80
|