# Authentik on an exe.dev VM. From https://exe.dev/deploy/authentik. # Based on Authentik's own compose.yml (https://docs.goauthentik.io/compose.yml), with: # - the server on 127.0.0.1:9000 only; nginx on :8000 and :8080 is the way in, # - no Docker socket for the worker, which would make it root on the VM # (it's only for outposts Authentik deploys itself; this recipe runs them by hand), # - ./blueprints mounted, for the rule that keeps admins on the private port. # Settings and secrets are in .env; AUTHENTIK_TAG there picks the version. services: postgresql: image: docker.io/library/postgres:16-alpine restart: unless-stopped env_file: .env environment: POSTGRES_DB: authentik POSTGRES_USER: authentik POSTGRES_PASSWORD: ${PG_PASS:?database password required} healthcheck: test: ["CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}"] interval: 30s retries: 5 start_period: 20s timeout: 5s volumes: - database:/var/lib/postgresql/data server: image: ghcr.io/goauthentik/server:${AUTHENTIK_TAG:?version required} command: server restart: unless-stopped env_file: .env environment: &env AUTHENTIK_POSTGRESQL__HOST: postgresql AUTHENTIK_POSTGRESQL__NAME: authentik AUTHENTIK_POSTGRESQL__USER: authentik AUTHENTIK_POSTGRESQL__PASSWORD: ${PG_PASS} AUTHENTIK_SECRET_KEY: ${AUTHENTIK_SECRET_KEY:?secret key required} depends_on: postgresql: condition: service_healthy ports: - 127.0.0.1:9000:9000 shm_size: 512mb volumes: - ./data:/data - ./custom-templates:/templates - ./blueprints:/blueprints/custom worker: image: ghcr.io/goauthentik/server:${AUTHENTIK_TAG} command: worker restart: unless-stopped env_file: .env environment: *env depends_on: postgresql: condition: service_healthy shm_size: 512mb volumes: - ./data:/data - ./certs:/certs - ./custom-templates:/templates - ./blueprints:/blueprints/custom volumes: database: