# Multi-stage: build with Node, serve with Caddy
FROM node:22-alpine AS builder

WORKDIR /app
COPY package.json package-lock.json* ./
RUN npm install --no-audit --no-fund
COPY . .
RUN npm run build

# Production: serve static files with Caddy
FROM caddy:2-alpine
COPY --from=builder /app/dist /srv
COPY Caddyfile.production /etc/caddy/Caddyfile
EXPOSE 80
