This commit is contained in:
stiti
2025-04-08 17:14:02 +02:00
parent a0e2bb3ee0
commit f05c9725a7
6 changed files with 460 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
# Utilisation d'Alpine Linux comme base légère
FROM httpd:alpine3.21
# Définition des labels
LABEL MAINTAINER="moncef" \
VERSION="1.8" \
TP="3"
# Configuration des variables d'environnement
ENV SCHOOL="IUT" \
LEVEL="1.8"
# Exposition du port 80
EXPOSE 80
# Clonage du dépôt Git (temporairement)
RUN apk add --no-cache git && \
git clone https://github.com/MaximePIERRONT/beforeStage.git /tmp/repo && \
cp /tmp/repo/static-site.html /usr/local/apache2/htdocs/index.html && \
# Personnalisation du fichier HTML
sed -i 's/NOM PRENOM/moncef/g' /usr/local/apache2/htdocs/index.html && \
# Nettoyage
rm -rf /tmp/repo && \
apk del git
# Configuration du healthcheck
HEALTHCHECK --interval=1m --timeout=1s \
CMD wget --no-verbose --tries=1 --spider http://localhost/ || exit 1
# Commande de démarrage d'Apache
# Note: Cette commande est déjà définie dans l'image de base et n'est pas nécessaire,
# mais je la laisse pour la clarté
CMD ["httpd-foreground"]