commit 0b143912bd2d9d3f99baf417c95e327736d90770 Author: gitea Date: Wed Sep 16 20:49:48 2026 +0200 ok ok diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..be04164 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,32 @@ +# Image de référence + FROM ubuntu:latest + +# Données méta + LABEL org.opencontainers.image.title="Serveur Apache" + LABEL org.opencontainers.image.version="1" + LABEL org.opencontainers.image.revision="0" + LABEL environment="formation" + +# Commandes exécuteés pendant la création de l’image + RUN apt-get update && apt-get upgrade -y + RUN apt install -y apache2 + RUN apt-get clean ; rm -rf /var/lib/apt/lists/* + +# Configuration Apache + RUN echo 'ServerName apache.formation.fr:80' >> /etc/apache2/apache2.conf + +# Spécifier de répertoire courant + WORKDIR /var/www/html/ + +# Copie du fichier host vers le conteneur + RUN mv index.html index.html.old + COPY index.html . + +# Commande lancée au démarrage du conteneur +# CMD ["/usr/sbin/apachectl", "-D", "FOREGROUND"] + +# Vérifie l’état de santé (pour un serveur web) +# HEALTHCHECK --start-period=30s --interval=1m --timeout=2s --retries=5 CMD curl -f http://localhost/ || exit 1 + +# Port réseau utilisé + EXPOSE 80/tcp diff --git a/compose.yaml b/compose.yaml new file mode 100644 index 0000000..7fa1d85 --- /dev/null +++ b/compose.yaml @@ -0,0 +1,46 @@ +networks: + frontend: + name: frontend + ipam: + config: + - subnet: 172.31.32.0/24 + labels: + com.example.purpose: "Frontend network" + backend: + external: true + name: backend + +volumes: + MariaDB.Data: + name: mariadb.data + +services: + phpmyadmin: + image: phpmyadmin:latest + container_name: pierreau.phpmyadmin + depends_on: + - mariadb + restart: on-failure + environment: + - PMA_ARBITRARY=1 + networks: + - frontend + - backend + ports: + - "8080:80" + + mariadb: + image: mariadb:latest + container_name: pierreau.mariadb + restart: always + networks: + - backend + expose: + - "3306" + environment: + MYSQL_ROOT_PASSWORD: MariaDBpwd + MYSQL_DATABASE: MariaDBdb + MYSQL_USER: MariaDBuser + MYSQL_PASSWORD: MariaDBpwd + volumes: + - MariaDB.Data:/var/lib/mysql diff --git a/index.html b/index.html new file mode 100644 index 0000000..b7fbfbb --- /dev/null +++ b/index.html @@ -0,0 +1,16 @@ + + + + Cloud de notre formation privée + + + + +

Le site Internet de notre formation

+

Notre serveur web est fonctionnel !

+ +