@@ -70,16 +70,27 @@ services:
7070 retries : 3
7171 start_period : 120s
7272 labels :
73+ # Enable Traefik for this container
7374 - " traefik.enable=true"
75+ # Match incoming requests on a specific hostname
7476 - " traefik.http.routers.rocketchat.rule=Host(`${ROCKETCHAT_HOSTNAME}`)"
77+ # Assign the router to a named Traefik service
7578 - " traefik.http.routers.rocketchat.service=rocketchat"
79+ # Use the 'websecure' (HTTPS) entry point
7680 - " traefik.http.routers.rocketchat.entrypoints=websecure"
81+ # Define the internal container port for routing
7782 - " traefik.http.services.rocketchat.loadbalancer.server.port=3000"
83+ # Enable TLS on this router
7884 - " traefik.http.routers.rocketchat.tls=true"
85+ # Use Let's Encrypt for certificate management
7986 - " traefik.http.routers.rocketchat.tls.certresolver=letsencrypt"
87+ # Pass the original Host header to the container
8088 - " traefik.http.services.rocketchat.loadbalancer.passhostheader=true"
89+ # Apply a compression middleware
8190 - " traefik.http.routers.rocketchat.middlewares=compresstraefik"
91+ # Define settings for the compression middleware
8292 - " traefik.http.middlewares.compresstraefik.compress=true"
93+ # Specify which Docker network Traefik should use for routing
8394 - " traefik.docker.network=traefik-network"
8495 restart : unless-stopped
8596 depends_on :
@@ -93,24 +104,42 @@ services:
93104 environment :
94105 - DOCKER_API_VERSION=1.47
95106 command :
107+ # Set the log level (DEBUG, INFO, WARN, ERROR)
96108 - " --log.level=${TRAEFIK_LOG_LEVEL}"
109+ # Enable the built-in API and web-based dashboard
97110 - " --api.dashboard=true"
111+ # Enable the /ping endpoint so we can health-check Traefik
98112 - " --ping=true"
113+ # Assign the /ping endpoint to a dedicated entry point on port 8082
99114 - " --ping.entrypoint=ping"
100115 - " --entrypoints.ping.address=:8082"
116+ # Define the primary HTTP entry point on port 80
101117 - " --entrypoints.web.address=:80"
118+ # Define the secure (HTTPS) entry point on port 443
102119 - " --entrypoints.websecure.address=:443"
120+ # HTTP -> HTTPS redirect at entrypoint level
103121 - " --entrypoints.web.http.redirections.entrypoint.to=websecure"
104122 - " --entrypoints.web.http.redirections.entrypoint.scheme=https"
123+ # Enable the Docker provider to detect containers and their labels
105124 - " --providers.docker=true"
125+ # Point Traefik to the Docker socket
106126 - " --providers.docker.endpoint=unix:///var/run/docker.sock"
127+ # Prevent automatic exposure of all containers; only expose containers
128+ # with "traefik.enable=true"
107129 - " --providers.docker.exposedbydefault=false"
130+ # Use ACME (Let's Encrypt) to generate/renew certificates via TLS challenge
108131 - " --certificatesresolvers.letsencrypt.acme.tlschallenge=true"
132+ # The email address used by Let's Encrypt for renewal notices
109133 - " --certificatesresolvers.letsencrypt.acme.email=${TRAEFIK_ACME_EMAIL}"
134+ # The file where ACME certificates are stored inside the container
110135 - " --certificatesresolvers.letsencrypt.acme.storage=/etc/traefik/acme/acme.json"
136+ # Enable Prometheus metrics
111137 - " --metrics.prometheus=true"
138+ # Configure Prometheus histogram buckets
112139 - " --metrics.prometheus.buckets=0.1,0.3,1.2,5.0"
140+ # Check for newer Traefik versions and optionally log that info
113141 - " --global.checknewversion=true"
142+ # Disable sending anonymous usage data to the Traefik maintainers
114143 - " --global.sendanonymoususage=false"
115144 volumes :
116145 - /var/run/docker.sock:/var/run/docker.sock:ro
@@ -127,14 +156,19 @@ services:
127156 retries : 3
128157 start_period : 5s
129158 labels :
159+ # Enable Traefik for this container
130160 - " traefik.enable=true"
161+ # A router to expose the Traefik dashboard
131162 - " traefik.http.routers.dashboard.rule=Host(`${TRAEFIK_HOSTNAME}`)"
132163 - " traefik.http.routers.dashboard.entrypoints=websecure"
133164 - " traefik.http.routers.dashboard.tls=true"
134165 - " traefik.http.routers.dashboard.tls.certresolver=letsencrypt"
135166 - " traefik.http.routers.dashboard.service=api@internal"
167+ # Basic Authentication for the Traefik dashboard
136168 - " traefik.http.routers.dashboard.middlewares=authtraefik"
137169 - " traefik.http.middlewares.authtraefik.basicauth.users=${TRAEFIK_BASIC_AUTH}"
170+ # Specify the internal server port to the dashboard service
138171 - " traefik.http.services.dashboard.loadbalancer.server.port=8080"
172+ # Pass the original Host header to the backend
139173 - " traefik.http.services.dashboard.loadbalancer.passhostheader=true"
140174 restart : unless-stopped
0 commit comments