services: postgresql: env_file: - .env 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: - /home/fejy/docker/authentik/database:/var/lib/postgresql/data networks: - authentik authentik-server: command: server depends_on: postgresql: condition: service_healthy 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} image: ${AUTHENTIK_IMAGE:-ghcr.io/goauthentik/server}:${AUTHENTIK_TAG:-2026.2.2-rc2} container_name: authentik-server restart: unless-stopped shm_size: 512mb volumes: - /home/fejy/docker/authentik/data:/data - /home/fejy/docker/authentik/custom-templates:/templates labels: - "traefik.enable=true" - "traefik.docker.network=proxy" - "traefik.http.routers.https-auth.entryPoints=websecure" - "traefik.http.routers.https-auth.rule=Host(`auth.nearfuture.industries`) || HostRegexp(`{subdomain:[a-z0-9-]+}.nearfuture.industries`) && PathPrefix(`/outpost.goauthentik.io/`)" - "traefik.http.routers.https-auth.tls=true" - "traefik.http.routers.https-auth.tls.certresolver=myresolver" - "traefik.http.routers.https-auth.priority=50" - "traefik.http.routers.https-auth.service=https-auth" - "traefik.http.services.https-auth.loadbalancer.server.port=9000" - "com.centurylinklabs.watchtower.scope=watch" networks: - proxy - authentik worker: command: worker depends_on: postgresql: condition: service_healthy 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} image: ${AUTHENTIK_IMAGE:-ghcr.io/goauthentik/server}:${AUTHENTIK_TAG:-2026.2.2-rc2} restart: unless-stopped shm_size: 512mb user: root volumes: - /var/run/docker.sock:/var/run/docker.sock - /home/fejy/docker/authentik/data:/data - /home/fejy/docker/authentik/certs:/certs - /home/fejy/docker/authentik/custom-templates:/templates labels: - "com.centurylinklabs.watchtower.scope=watch" networks: - authentik networks: proxy: external: true authentik: