feat: authentik service+envfile for traefik and authentik

This commit is contained in:
2025-12-08 01:29:00 +01:00
parent be049cfa0d
commit f3b73bae11
2 changed files with 97 additions and 0 deletions
+75
View File
@@ -86,6 +86,81 @@ services:
environment:
- TZ=Europe/Bratislava
postgresql:
image: docker.io/library/postgres:15
restart: unless-stopped
container_name: authentik-postgresql
env_file:
- .env
environment:
POSTGRES_DB: ${PG_DB:-authentik}
POSTGRES_PASSWORD: ${PG_PASS:?database password required}
POSTGRES_USER: ${PG_USER:-authentik}
volumes:
- auth-database:/var/lib/postgresql/data
healthcheck:
interval: 30s
retries: 5
start_period: 20s
test:
- CMD-SHELL
- pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}
timeout: 5s
server:
image: ghcr.io/goauthentik/server:${AUTHENTIK_TAG:-2025.10.2}
restart: unless-stopped
container_name: authentik-server
command: server
ports:
- ${PORT_HTTP:-9000}:9000
- ${PORT_HTTPS:-9443}:9443
env_file:
- .env
environment:
AUTHENTIK_POSTGRESQL__HOST: postgresql
AUTHENTIK_POSTGRESQL__NAME: ${PG_DB:-authentik}
AUTHENTIK_POSTGRESQL__PASSWORD: ${PG_PASS}
AUTHENTIK_POSTGRESQL__USER: ${PG_USER:-authentik}
AUTHENTIK_SECRET_KEY: ${AUTHENTIK_SECRET_KEY:?secret key required}
volumes:
- ./auth-media:/media
- ./auth-custom-templates:/templates
networks:
- traefik-proxy
depends_on:
postgresql:
condition: service_healthy
worker:
image: ghcr.io/goauthentik/server:${AUTHENTIK_TAG:-2025.10.2}
restart: unless-stopped
container_name: authentik-worker
command: worker
user: root
env_file:
- .env
environment:
AUTHENTIK_POSTGRESQL__HOST: postgresql
AUTHENTIK_POSTGRESQL__NAME: ${PG_DB:-authentik}
AUTHENTIK_POSTGRESQL__PASSWORD: ${PG_PASS}
AUTHENTIK_POSTGRESQL__USER: ${PG_USER:-authentik}
AUTHENTIK_SECRET_KEY: ${AUTHENTIK_SECRET_KEY:?secret key required}
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./auth-media:/media
- ./certs:/certs
- ./auth-custom-templates:/templates
depends_on:
postgresql:
condition: service_healthy
networks:
- traefik-proxy
volumes:
auth-database:
driver: local
networks:
traefik-proxy:
external: true