20 lines
404 B
Docker
20 lines
404 B
Docker
# ── Stage 1 : Build Astro ──
|
|
FROM node:20-alpine AS build
|
|
|
|
WORKDIR /app
|
|
COPY package.json package-lock.json ./
|
|
RUN npm ci
|
|
COPY . .
|
|
RUN npm run build
|
|
|
|
# ── Stage 2 : Serve static files ──
|
|
FROM nginx:alpine
|
|
|
|
# Config nginx optimisée pour un site statique
|
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
|
|
|
# Copier le build Astro
|
|
COPY --from=build /app/dist /usr/share/nginx/html
|
|
|
|
EXPOSE 80
|