Initialisation de Docker.

This commit is contained in:
2025-12-12 22:23:47 +01:00
commit 383b3105d9
5 changed files with 69 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
# À définir pour éviter les problèmes sur les multi-projets Docker
COMPOSE_PROJECT_NAME=""
COMPOSE_FILE=docker-compose.yml
# Traefik
TRAEFIK_IMAGE=traefik:v3.6
# URL d'accès au dashboard de Traefik
TRAEFIK_URL=""
# Basic Auth pour le dashboard
TRAEFIK_HTPASSWD=""
# Email pour Let's Encrypt
LETSENCRYPT_EMAIL=""
+3
View File
@@ -0,0 +1,3 @@
.env
certs/*.crt
certs/*.key
View File
+46
View File
@@ -0,0 +1,46 @@
networks:
frontend:
external: true
name: frontend
backend:
services:
# Configuration de Traefik
traefik:
image: ${TRAEFIK_IMAGE}
container_name: traefik
ports:
- "80:80"
- "443:443"
command:
- "--api.dashboard=true"
- "--api.insecure=false"
#
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--providers.docker.network=frontend"
- "--providers.file.filename=./tls.yaml"
#
- "--entrypoints.web.address=:80"
- "--entrypoints.web.http.redirections.entrypoint.to=websecure"
- "--entrypoints.web.http.redirections.entrypoint.scheme=https"
- "--entrypoints.web.http.redirections.entrypoint.permanent=true"
- "--entrypoints.websecure.address=:443"
- "--entrypoints.websecure.http.tls=true"
#
labels:
- "traefik.enable=true"
#
- "traefik.http.routers.traefik_dashboard.rule=Host(`${TRAEFIK_URL}`)"
- "traefik.http.routers.traefik_dashboard.entrypoints=websecure"
- "traefik.http.routers.traefik_dashboard.service=api@internal"
- "traefik.http.routers.traefik_dashboard.tls=true"
- "traefik.http.middlewares.traefik_dashboard-auth.basicauth.users=${TRAEFIK_HTPASSWD}"
- "traefik.http.routers.traefik_dashboard.middlewares=traefik_dashboard-auth@docker"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./certs:/certs:ro
networks:
- frontend
- backend
+4
View File
@@ -0,0 +1,4 @@
tls:
certificates:
- certFile: /certs/localhost.crt
- keyFile: /certs/localhost.key