Files
Docker/Dockerfile
2026-04-19 12:36:04 +02:00

33 lines
1023 B
Docker
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 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 limage
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