Files
Le Prévost-Corvellec Arnault 2f5065bf37 Add Docker and Gitea workflow configurations for Talks slides deployment
- Introduced .dockerignore to exclude unnecessary files from Docker builds.
- Added build-and-push.yaml workflow for automated image building and Helm chart deployment on changes to specific paths.
- Created Dockerfile for building a static site with Nginx, including configuration for serving slides.
- Established Helm chart structure in talks-slides-dist for managing deployment configurations and resources.
- Removed outdated GitHub Actions workflows to streamline CI/CD processes.
2026-04-11 16:53:09 +02:00

38 lines
1.1 KiB
Docker

# syntax=docker/dockerfile:1
# Image statique : build npm (VitePress + Slidev) puis nginx non-root.
FROM node:22-bookworm-slim AS builder
WORKDIR /app
COPY package.json package-lock.json ./
# npm 10 (image officielle) et npm 11 (lock généré localement) divergent sur la validation du lock ; `install` reste déterministe via package-lock.
RUN npm install
COPY . .
RUN npm run build
# Même arborescence que tools/static-preview.mjs : portail à la racine, decks sous slides/<slug>/
RUN set -eux \
&& mkdir -p /opt/site \
&& cp -a dist-portal/. /opt/site/ \
&& for d in dist-*; do \
[ -d "$d" ] || continue; \
[ "$d" = "dist-portal" ] && continue; \
slug="${d#dist-}"; \
mkdir -p "/opt/site/slides/${slug}"; \
cp -a "${d}/." "/opt/site/slides/${slug}/"; \
done
FROM nginxinc/nginx-unprivileged:stable-alpine
ARG UID=101
ARG GID=101
USER root
COPY --from=builder /opt/site /usr/share/nginx/html
COPY server/nginx/default.conf /etc/nginx/conf.d/default.conf
RUN chown -R "${UID}:${GID}" /usr/share/nginx/html
USER ${UID}
EXPOSE 8080
CMD ["nginx", "-g", "daemon off;"]