ok
ok
This commit is contained in:
+32
@@ -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
|
||||||
@@ -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
|
||||||
+16
@@ -0,0 +1,16 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="fr">
|
||||||
|
<head>
|
||||||
|
<title>Cloud de notre formation privée</title>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<style>
|
||||||
|
body { background-color: darkgrey; color: black;}
|
||||||
|
h1 { color: LightGreen }
|
||||||
|
img { width: 60%; margin: auto; display: block; }
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Le site Internet de notre formation</h1>
|
||||||
|
<p>Notre serveur web est fonctionnel !</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Reference in New Issue
Block a user