Files
decision/docker/frontend.Dockerfile
T
YvvandClaude Fable 5 493836ff11 build : @yvv/nuxt-base en git+https + git dans les environnements npm
- la dép git+ssh échouait en CI : pas de clé SSH dans les conteneurs, et
  node:20-slim n'a pas le binaire git (ENOENT) — npm signalait un faux
  « tarball corrupted »
- package.json + lock : git+https://git.open.us.org/… (#v0.1.0 → b1c6a2f,
  même commit épinglé) — nécessite le repo yvv-nuxt-base public
- git + ca-certificates ajoutés : step test-frontend (.woodpecker.yml) et
  image de base du frontend.Dockerfile
- vérifié : npm install + build zéro erreur

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-12 01:13:22 +02:00

52 lines
1.5 KiB
Docker

# syntax = docker/dockerfile:1
ARG NODE_VERSION=20-slim
FROM node:${NODE_VERSION} AS base
WORKDIR /src
RUN apt-get update && \
apt-get install -y --no-install-recommends curl git ca-certificates && \
rm -rf /var/lib/apt/lists/*
# ── Build ─────────────────────────────────────────────────────────────────────
FROM base AS build
ENV NODE_ENV=development
COPY frontend/package.json frontend/package-lock.json* ./
RUN npm ci
COPY frontend/ .
RUN npm run build
# ── Production ────────────────────────────────────────────────────────────────
FROM base AS production
ENV PORT=3000 \
NODE_ENV=production
COPY --from=build /src/.output /src/.output
EXPOSE $PORT
HEALTHCHECK --interval=30s --timeout=5s --start-period=15s --retries=3 \
CMD curl -f http://localhost:${PORT}/ || exit 1
CMD ["node", ".output/server/index.mjs"]
# ── Development ───────────────────────────────────────────────────────────────
FROM base AS development
ENV NODE_ENV=development
WORKDIR /app
COPY frontend/package.json ./
RUN npm install
EXPOSE 3002
CMD ["npm", "run", "dev"]