Files
Talks/server/Dockerfile
T

25 lines
966 B
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.
FROM nginx:alpine
RUN apk add --no-cache git
WORKDIR /usr/share/nginx/html
# Image figée au clone ; le conteneur met à jour via refresh.sh (git pull origin main).
# Seul le dossier content/ est extrait (sparse checkout) : léger et aligné sur la racine Nginx.
# L’image nginx:alpine place déjà des fichiers ici — il faut vider le répertoire avant git clone vers « . ».
ARG TALKS_REPO_URL=https://git.specificat.io/arnault/Talks.git
ARG TALKS_BRANCH=main
ARG TALKS_SPARSE_DIR=content
RUN find . -mindepth 1 -delete \
&& git clone --filter=blob:none --sparse --branch "${TALKS_BRANCH}" --single-branch "${TALKS_REPO_URL}" . \
&& git sparse-checkout init --cone \
&& git sparse-checkout set "${TALKS_SPARSE_DIR}" \
&& git config --global --add safe.directory /usr/share/nginx/html
COPY nginx/default.conf /etc/nginx/conf.d/default.conf
COPY refresh.sh /refresh.sh
RUN chmod +x /refresh.sh
CMD sh -c "/refresh.sh & exec nginx -g 'daemon off;'"