Ajouts
This commit is contained in:
		
							
								
								
									
										33
									
								
								TP3/exo2-dockerfile/Dockerfile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										33
									
								
								TP3/exo2-dockerfile/Dockerfile
									
									
									
									
									
										Normal 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"]
 | 
			
		||||
		Reference in New Issue
	
	Block a user