mirror of
https://github.com/Viren070/docker-compose-template.git
synced 2025-12-01 23:17:00 +01:00
75 lines
2.4 KiB
YAML
75 lines
2.4 KiB
YAML
services:
|
|
authelia:
|
|
container_name: 'authelia'
|
|
image: 'authelia/authelia'
|
|
restart: 'unless-stopped'
|
|
user: $PUID:$PGID
|
|
environment:
|
|
TZ: ${TZ:-Etc/UTC}
|
|
X_AUTHELIA_CONFIG_FILTERS: template
|
|
TEMPLATE_AUTHELIA_SESSION_SECRET: ${AUTHELIA_SESSION_SECRET?}
|
|
TEMPLATE_DOMAIN: ${DOMAIN?}
|
|
TEMPLATE_AUTHELIA_HOSTNAME: ${AUTHELIA_HOSTNAME?}
|
|
TEMPLATE_AUTHELIA_STORAGE_ENCRYPTION_KEY: ${AUTHELIA_STORAGE_ENCRYPTION_KEY?}
|
|
TEMPLATE_AUTHELIA_WEBAUTHN_DISPLAY_NAME: ${AUTHELIA_WEBAUTHN_DISPLAY_NAME?}
|
|
TEMPLATE_AUTHELIA_JWT_SECRET: ${AUTHELIA_JWT_SECRET?}
|
|
TEMPLATE_STREMIO_ADDON_HOSTNAMES: ${STREMIO_ADDON_HOSTNAMES?}
|
|
labels:
|
|
- "traefik.enable=true"
|
|
- "traefik.http.routers.authelia.rule=Host(`${AUTHELIA_HOSTNAME?}`)"
|
|
- "traefik.http.routers.authelia.entryPoints=websecure"
|
|
- "traefik.http.routers.authelia.tls.certresolver=letsencrypt"
|
|
- "traefik.http.services.authelia.loadbalancer.server.port=9091"
|
|
- "traefik.http.middlewares.authelia.forwardAuth.address=http://authelia:9091/api/authz/forward-auth"
|
|
- "traefik.http.middlewares.authelia.forwardAuth.trustForwardHeader=true"
|
|
- "traefik.http.middlewares.authelia.forwardAuth.authResponseHeaders=Remote-User,Remote-Groups,Remote-Email,Remote-Name"
|
|
volumes:
|
|
- './config:/config'
|
|
depends_on:
|
|
authelia_redis:
|
|
condition: service_healthy
|
|
authelia_postgres:
|
|
condition: service_healthy
|
|
profiles:
|
|
- authelia
|
|
- required
|
|
- all
|
|
|
|
authelia_redis:
|
|
image: redis:latest
|
|
container_name: authelia_redis
|
|
restart: unless-stopped
|
|
volumes:
|
|
- ${DOCKER_DATA_DIR}/authelia/cache:/data
|
|
command: redis-server --appendonly yes --save 60 1
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
profiles:
|
|
- authelia
|
|
- required
|
|
- all
|
|
|
|
authelia_postgres:
|
|
image: postgres:17-alpine
|
|
restart: unless-stopped
|
|
container_name: authelia_postgres
|
|
volumes:
|
|
- ${DOCKER_DATA_DIR}/authelia/db:/var/lib/postgresql/data
|
|
environment:
|
|
POSTGRES_USER: authelia
|
|
POSTGRES_PASSWORD: authelia
|
|
POSTGRES_DB: authelia
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U authelia -d authelia"]
|
|
start_period: 1m
|
|
interval: 20s
|
|
timeout: 5s
|
|
retries: 5
|
|
profiles:
|
|
- authelia
|
|
- required
|
|
- all
|