--- services: postgresql: environment: POSTGRES_DB: ${PG_DB:-authentik} POSTGRES_PASSWORD: ${PG_PASS:?database password required} POSTGRES_USER: ${PG_USER:-authentik} healthcheck: interval: 30s retries: 5 start_period: 20s test: - CMD-SHELL - pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER} timeout: 5s image: docker.io/library/postgres:16-alpine restart: unless-stopped volumes: - database:/var/lib/postgresql/data networks: - authentik server: command: server depends_on: postgresql: condition: service_healthy 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} image: ${AUTHENTIK_IMAGE:-ghcr.io/goauthentik/server}:${AUTHENTIK_TAG:-2025.10.3} #ports: #- ${COMPOSE_PORT_HTTP:-9000}:9000 #- ${COMPOSE_PORT_HTTPS:-9443}:9443 networks: - authentik - newt restart: unless-stopped volumes: - /opt/containers/authentik/media:/media - /opt/containers/authentik/custom-templates:/templates worker: command: worker depends_on: postgresql: condition: service_healthy 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} image: ${AUTHENTIK_IMAGE:-ghcr.io/goauthentik/server}:${AUTHENTIK_TAG:-2025.10.3} restart: unless-stopped user: root volumes: - /var/run/docker.sock:/var/run/docker.sock - /opt/containers/authentik/media:/media - /opt/containers/authentik/certs:/certs - /opt/containers/authentik/custom-templates:/templates networks: - authentik volumes: database: driver: local networks: authentik: newt: external: true