ajout dev docker

This commit is contained in:
EmmanuelTiamzon
2026-06-04 18:57:15 +02:00
parent 2d17b25873
commit d12a1adb6d
34 changed files with 1255 additions and 0 deletions
@@ -0,0 +1,9 @@
# TP 3 : Dockerfile
## Actions à réaliser
### 1. Création du Dockerfile
```Dockerfile
FROM alpine:3.23 AS DF
RUN apt install apache2
LABEL maintainer="srivastava" version="1.8" TP="3"
```
+23
View File
@@ -0,0 +1,23 @@
FROM alpine:3.23
RUN apk add apache2
LABEL MAINTAINER="srivastava" VERSION="1.8" TP="3"
# Ajout de métadonnées pour le mainteneur, la version et le numéro du TP
ENV SCHOOL="IUT" LEVEL="1.8"
# Définition de variables d environnement pour l école et le niveau
EXPOSE 80
# Exposition du port 80 pour le serveur web
RUN apk add git && git clone https://github.com/MaximePIERRONT/beforeStage.git /tmp/repo && cp /tmp/repo/static-site.html /var/www/localhost/htdocs/static-site.html && rm -rf /tmp/repo && apk del git
# Installation de git, clonage du dépôt, copie du fichier HTML dans le répertoire de l hôte web, suppression du dépôt et désinstallation de git
RUN sed -i 's/NOM PRENOM/SRIVASTAVA Emmanuel/g' /var/www/localhost/htdocs/static-site.html
# Modification du fichier HTML pour remplacer "NOM PRENOM" par "SRIVASTAVA Emmanuel"
HEALTHCHECK --interval=1m --timeout=1s CMD wget --no-verbose --tries=1 --spider http://localhost/ || exit 1
CMD ["/usr/sbin/httpd", "-D", "FOREGROUND"]
# Commande pour démarrer le serveur Apache en mode premier plan