56 lines
1.6 KiB
YAML
56 lines
1.6 KiB
YAML
services:
|
|
traefik:
|
|
image: ${TRAEFIK_IMAGE}
|
|
container_name: traefik
|
|
restart: unless-stopped
|
|
extra_hosts:
|
|
- "host.docker.internal:host-gateway"
|
|
|
|
command:
|
|
# Logs
|
|
- "--log.level=${TRAEFIK_LOG_LEVEL}"
|
|
|
|
# Dashboard (por ahora solo interno)
|
|
- "--api.dashboard=true"
|
|
- "--api.insecure=false"
|
|
|
|
# Entrypoints
|
|
- "--entrypoints.web.address=:80"
|
|
- "--entrypoints.websecure.address=:443"
|
|
|
|
# Redirección HTTP -> HTTPS
|
|
- "--entrypoints.web.http.redirections.entrypoint.to=websecure"
|
|
- "--entrypoints.web.http.redirections.entrypoint.scheme=https"
|
|
|
|
# Proveedor Docker
|
|
- "--providers.docker=true"
|
|
- "--providers.docker.exposedbydefault=false"
|
|
- "--providers.docker.network=${TRAEFIK_DOCKER_NETWORK}"
|
|
|
|
# Proveedor de ficheros dinámicos
|
|
- "--providers.file.directory=/dynamic"
|
|
- "--providers.file.watch=true"
|
|
|
|
# ACME / Let's Encrypt (resolver "letsencrypt")
|
|
- "--certificatesresolvers.letsencrypt.acme.email=${TRAEFIK_ACME_EMAIL}"
|
|
- "--certificatesresolvers.letsencrypt.acme.storage=${TRAEFIK_ACME_STORAGE}"
|
|
- "--certificatesresolvers.letsencrypt.acme.httpchallenge=true"
|
|
- "--certificatesresolvers.letsencrypt.acme.httpchallenge.entrypoint=web"
|
|
|
|
ports:
|
|
- "${TRAEFIK_HTTP_PORT}:80"
|
|
- "${TRAEFIK_HTTPS_PORT}:443"
|
|
|
|
volumes:
|
|
- /var/run/docker.sock:/var/run/docker.sock:ro,Z
|
|
- ${TRAEFIK_DYNAMIC_DIR}:/dynamic:Z
|
|
- ${TRAEFIK_LETSENCRYPT_DIR}:/letsencrypt:Z
|
|
|
|
networks:
|
|
- proxy
|
|
|
|
networks:
|
|
proxy:
|
|
external: true
|
|
|