mirror of
https://github.com/idrainformatica/PecFlow.git
synced 2026-06-16 12:45:42 +02:00
28 lines
1.2 KiB
Docker
28 lines
1.2 KiB
Docker
FROM node:20-alpine AS base
|
|
WORKDIR /app
|
|
|
|
# ── Installazione dipendenze ─────────────────────────────────────────────────
|
|
FROM base AS deps
|
|
COPY package.json package-lock.json* ./
|
|
RUN npm ci --prefer-offline
|
|
|
|
# ── Build di produzione ─────────────────────────────────────────────────────
|
|
FROM base AS builder
|
|
COPY --from=deps /app/node_modules ./node_modules
|
|
COPY . .
|
|
RUN npm run build
|
|
|
|
# ── Runtime (nginx serve) ───────────────────────────────────────────────────
|
|
FROM nginx:alpine AS runner
|
|
COPY --from=builder /app/dist /usr/share/nginx/html
|
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
|
EXPOSE 3000
|
|
CMD ["nginx", "-g", "daemon off;"]
|
|
|
|
# ── Sviluppo (hot reload) ───────────────────────────────────────────────────
|
|
FROM base AS dev
|
|
COPY --from=deps /app/node_modules ./node_modules
|
|
COPY . .
|
|
EXPOSE 3000
|
|
CMD ["npm", "run", "dev"]
|