2023-09-27 15:50:33 +00:00
|
|
|
version: "3.4"
|
|
|
|
|
|
|
|
services:
|
|
|
|
|
|
|
|
postgresql:
|
2023-09-29 09:50:31 +00:00
|
|
|
image: docker.io/library/postgres:16-alpine
|
2023-09-27 15:50:33 +00:00
|
|
|
container_name: authentik-psql
|
|
|
|
restart: unless-stopped
|
|
|
|
healthcheck:
|
|
|
|
test: ["CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}"]
|
|
|
|
start_period: 20s
|
|
|
|
interval: 30s
|
|
|
|
retries: 5
|
|
|
|
timeout: 5s
|
|
|
|
volumes:
|
|
|
|
- ${DOCKER_VOLUME_STORAGE:-/mnt/docker-volumes}/authentik/psql:/var/lib/postgresql/data
|
|
|
|
environment:
|
|
|
|
POSTGRES_PASSWORD: ${PG_PASS:-authentik}
|
|
|
|
POSTGRES_USER: ${PG_USER:-authentik}
|
|
|
|
POSTGRES_DB: ${PG_DB:-authentik}
|
2023-09-27 16:02:06 +00:00
|
|
|
env_file:
|
2023-09-29 09:50:31 +00:00
|
|
|
- .env
|
2023-09-27 15:50:33 +00:00
|
|
|
networks:
|
|
|
|
- authentik-internal
|
|
|
|
|
|
|
|
redis:
|
|
|
|
image: docker.io/library/redis:alpine
|
|
|
|
container_name: authentik-redis
|
|
|
|
command: --save 60 1 --loglevel warning
|
|
|
|
restart: unless-stopped
|
|
|
|
healthcheck:
|
|
|
|
test: ["CMD-SHELL", "redis-cli ping | grep PONG"]
|
|
|
|
start_period: 20s
|
|
|
|
interval: 30s
|
|
|
|
retries: 5
|
|
|
|
timeout: 3s
|
|
|
|
volumes:
|
|
|
|
- ${DOCKER_VOLUME_STORAGE:-/mnt/docker-volumes}/authentik/redis:/data
|
|
|
|
networks:
|
|
|
|
- authentik-internal
|
|
|
|
|
|
|
|
authentik-proxy:
|
2024-09-11 07:44:28 +00:00
|
|
|
image: ghcr.io/goauthentik/server:${AUTHENTIK_VERSION:-2024.8}
|
2023-09-27 15:50:33 +00:00
|
|
|
container_name: authentik
|
|
|
|
restart: unless-stopped
|
|
|
|
command: server
|
|
|
|
environment:
|
|
|
|
AUTHENTIK_REDIS__HOST: redis
|
|
|
|
AUTHENTIK_POSTGRESQL__HOST: postgresql
|
|
|
|
AUTHENTIK_POSTGRESQL__USER: ${PG_USER:-authentik}
|
|
|
|
AUTHENTIK_POSTGRESQL__NAME: ${PG_DB:-authentik}
|
|
|
|
AUTHENTIK_POSTGRESQL__PASSWORD: ${PG_PASS:-authentik}
|
2023-09-27 15:54:09 +00:00
|
|
|
AUTHENTIK_SECRET_KEY: ${AUTHENTIK_SECRET_KEY:-authentiksupersecretkey}
|
2023-09-27 15:50:33 +00:00
|
|
|
volumes:
|
|
|
|
- ${DOCKER_VOLUME_STORAGE:-/mnt/docker-volumes}/authentik/media:/media
|
|
|
|
- ${DOCKER_VOLUME_STORAGE:-/mnt/docker-volumes}/authentik/custom-templates:/templates
|
2024-09-26 07:46:07 +00:00
|
|
|
ports:
|
|
|
|
- 9000
|
2023-09-27 15:50:33 +00:00
|
|
|
expose:
|
|
|
|
- 9000
|
|
|
|
- 9443
|
2023-09-27 16:02:06 +00:00
|
|
|
env_file:
|
2023-09-29 09:50:31 +00:00
|
|
|
- .env
|
2023-09-27 15:50:33 +00:00
|
|
|
depends_on:
|
|
|
|
- postgresql
|
|
|
|
- redis
|
|
|
|
networks:
|
|
|
|
- proxy
|
|
|
|
- authentik-internal
|
2024-09-26 07:46:07 +00:00
|
|
|
#labels:
|
|
|
|
# - traefik.enable=true
|
|
|
|
# - traefik.http.routers.authentik.rule=Host(`authentik.example.com`) || HostRegexp(`{subdomain:[A-Za-z0-9](?:[A-Za-z0-9\-]{0,61}[A-Za-z0-9])?}.example.com`) && PathPrefix(`/outpost.goauthentik.io/`)
|
|
|
|
# - traefik.http.services.authentik.loadbalancer.server.port=9000
|
|
|
|
# - traefik.docker.network=proxy
|
|
|
|
# - traefik.http.middlewares.authentik.forwardauth.address=http://authentik-proxy:9000/outpost.goauthentik.io/auth/traefik
|
|
|
|
# - traefik.http.middlewares.authentik.forwardauth.trustForwardHeader=true
|
|
|
|
# - traefik.http.middlewares.authentik.forwardauth.authResponseHeaders=X-authentik-username,X-authentik-groups,X-authentik-email,X-authentik-name,X-authentik-uid,X-authentik-jwt,X-authentik-meta-jwks,X-authentik-meta-outpost,X-authentik-meta-provider,X-authentik-meta-app,X-authentik-meta-version
|
2023-09-27 15:50:33 +00:00
|
|
|
|
|
|
|
worker:
|
2024-09-11 07:44:28 +00:00
|
|
|
image: ghcr.io/goauthentik/server:${AUTHENTIK_VERSION:-2024.8}
|
2023-09-27 15:50:33 +00:00
|
|
|
container_name: authentik-worker
|
|
|
|
restart: unless-stopped
|
|
|
|
command: worker
|
|
|
|
user: root
|
|
|
|
environment:
|
|
|
|
AUTHENTIK_REDIS__HOST: redis
|
|
|
|
AUTHENTIK_POSTGRESQL__HOST: postgresql
|
|
|
|
AUTHENTIK_POSTGRESQL__USER: ${PG_USER:-authentik}
|
|
|
|
AUTHENTIK_POSTGRESQL__NAME: ${PG_DB:-authentik}
|
|
|
|
AUTHENTIK_POSTGRESQL__PASSWORD: ${PG_PASS:-authentik}
|
2023-09-27 15:54:09 +00:00
|
|
|
AUTHENTIK_SECRET_KEY: ${AUTHENTIK_SECRET_KEY:-authentiksupersecretkey}
|
2023-09-27 15:50:33 +00:00
|
|
|
volumes:
|
|
|
|
- ${DOCKER_VOLUME_STORAGE:-/mnt/docker-volumes}/authentik/certs:/certs
|
|
|
|
- ${DOCKER_VOLUME_STORAGE:-/mnt/docker-volumes}/authentik/media:/media
|
|
|
|
- ${DOCKER_VOLUME_STORAGE:-/mnt/docker-volumes}/authentik/custom-templates:/templates
|
2023-09-27 16:02:06 +00:00
|
|
|
env_file:
|
|
|
|
- .env
|
|
|
|
depends_on:
|
|
|
|
- postgresql
|
2024-09-11 07:45:33 +00:00
|
|
|
- redis
|
2023-09-27 15:50:33 +00:00
|
|
|
networks:
|
2024-09-26 07:59:05 +00:00
|
|
|
- proxy
|
2023-09-27 15:50:33 +00:00
|
|
|
- authentik-internal
|
|
|
|
|
|
|
|
networks:
|
|
|
|
proxy:
|
|
|
|
external: true
|
|
|
|
authentik-internal:
|
2024-09-26 07:52:28 +00:00
|
|
|
internal: true
|