Jafner.net/homelab/server/config/authentik/docker-compose.yml

110 lines
2.9 KiB
YAML
Raw Normal View History

2022-07-06 11:27:59 -07:00
version: '3'
2022-02-08 17:00:27 -08:00
services:
postgresql:
image: postgres:12-alpine
container_name: authentik_postgres
2022-02-08 17:00:27 -08:00
restart: unless-stopped
2022-07-06 11:27:59 -07:00
healthcheck:
test: ["CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}"]
start_period: 20s
interval: 30s
retries: 5
timeout: 5s
2022-02-08 17:00:27 -08:00
networks:
- authentik
volumes:
- database:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=${PG_PASS}
- POSTGRES_USER=${PG_USER:-authentik}
- POSTGRES_DB=${PG_DB:-authentik}
env_file:
- .env
redis:
image: redis:alpine
container_name: authentik_redis
2022-07-06 11:27:59 -07:00
healthcheck:
test: ["CMD-SHELL", "redis-cli ping | grep PONG"]
start_period: 20s
interval: 30s
retries: 5
timeout: 3s
2022-02-08 17:00:27 -08:00
networks:
- authentik
restart: unless-stopped
server:
2022-07-06 11:27:59 -07:00
image: ${AUTHENTIK_IMAGE:-ghcr.io/goauthentik/server}:${AUTHENTIK_TAG:-2022.7.1}
container_name: authentik_authentik
2022-02-08 17:00:27 -08:00
networks:
authentik:
web:
aliases:
- authentik-server
2022-02-08 17:00:27 -08:00
restart: unless-stopped
command: server
environment:
AUTHENTIK_HOST: http://authentik-server:9000
AUTHENTIK_HOST_BROWSER: https://authentik.jafner.net
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}
volumes:
- ${DOCKER_DATA}/media:/media
- ${DOCKER_DATA}/custom-templates:/templates
env_file:
- .env
labels:
traefik.http.routers.authentik.rule: Host(`authentik.jafner.net`)
traefik.http.routers.authentik.tls.certresolver: lets-encrypt
traefik.http.routers.authentik.middlewares: securityheaders@file
2022-02-08 17:00:27 -08:00
traefik.http.services.authentik.loadbalancer.server.port: 9000
worker:
image: ${AUTHENTIK_IMAGE:-ghcr.io/goauthentik/server}:${AUTHENTIK_TAG:-2022.1.3}
container_name: authentik_worker
2022-02-08 17:00:27 -08:00
restart: unless-stopped
networks:
- authentik
command: worker
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}
user: root
volumes:
- ${DOCKER_DATA}/backups:/backups
- ${DOCKER_DATA}/media:/media
- ${DOCKER_DATA}/certs:/certs
- /var/run/docker.sock:/var/run/docker.sock
- ${DOCKER_DATA}/custom-templates:/templates
env_file:
- .env
labels:
traefik.enable: false
2022-07-06 14:31:58 -07:00
adminer:
image: adminer:4.8.1
hostname: authentik_adminer
container_name: adminer
restart: unless-stopped
ports:
- 8686:8080
networks:
- authentik
2022-02-08 17:00:27 -08:00
volumes:
database:
driver: local
networks:
authentik:
web:
external: true