Files
archicratie-edition/Dockerfile
archicratia 60d88939b0
All checks were successful
CI / build-and-anchors (push) Successful in 1m25s
SMOKE / smoke (push) Successful in 11s
CI / build-and-anchors (pull_request) Successful in 1m20s
Seed from NAS prod snapshot 20260130-190531
2026-01-31 10:51:38 +00:00

40 lines
1.2 KiB
Docker
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# syntax=docker/dockerfile:1.6
# ---- Build stage (Debian, plus robuste que alpine pour npm)
FROM node:22-bookworm-slim AS build
WORKDIR /app
# NPM moins bavard + moins de trucs qui cassent en CI
ENV npm_config_update_notifier=false \
npm_config_audit=false \
npm_config_fund=false \
npm_config_progress=false
# (Optionnel mais propre) git + certificats
RUN --network=host apt-get -o Acquire::Retries=5 -o Acquire::ForceIPv4=true update \
&& apt-get install -y --no-install-recommends ca-certificates git \
&& rm -rf /var/lib/apt/lists/*
# Déps dabord (cache Docker)
COPY package.json package-lock.json ./
RUN npm ci --no-audit --no-fund
# Sources
COPY . .
# Variables publiques injectées au build (import.meta.env.PUBLIC_*)
ARG PUBLIC_GITEA_BASE
ARG PUBLIC_GITEA_OWNER
ARG PUBLIC_GITEA_REPO
ENV PUBLIC_GITEA_BASE=$PUBLIC_GITEA_BASE \
PUBLIC_GITEA_OWNER=$PUBLIC_GITEA_OWNER \
PUBLIC_GITEA_REPO=$PUBLIC_GITEA_REPO
# Build Astro (postbuild tourne via npm scripts)
RUN npm run build
# ---- Runtime stage (nginx)
FROM nginx:1.27-alpine AS runtime
COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=build /app/dist/ /usr/share/nginx/html/
EXPOSE 80