ansible-role-authentik/templates/docker-compose.yml.j2

95 lines
3.3 KiB
Plaintext
Raw Normal View History

2022-09-16 16:07:01 +02:00
---
version: '3.4'
services:
2022-09-16 22:34:37 +02:00
postgresql:
2022-09-16 16:07:01 +02:00
image: docker.io/library/postgres:12-alpine
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:
- {{ authentik_volume_db }}:/var/lib/postgresql/data
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
2022-09-16 16:07:01 +02:00
environment:
- POSTGRES_PASSWORD={{ authentik_db_password }}
- POSTGRES_USER={{ authentik_db_user }}
- POSTGRES_DB={{ authentik_db }}
env_file:
- {{ authentik_volume_config }}/env.authentik.conf
2022-09-16 22:34:37 +02:00
redis:
2022-09-16 16:07:01 +02:00
image: docker.io/library/redis:alpine
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:
- {{ authentik_volume_redis }}:/data
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
2022-09-16 16:07:01 +02:00
server:
image: ghcr.io/goauthentik/server:{{ authentik_image_version }}
restart: unless-stopped
command: server
environment:
2022-09-16 22:34:37 +02:00
AUTHENTIK_REDIS__HOST: redis
AUTHENTIK_POSTGRESQL__HOST: postgresql
2022-09-16 16:07:01 +02:00
AUTHENTIK_POSTGRESQL__NAME: "{{ authentik_db }}"
AUTHENTIK_POSTGRESQL__USER: "{{ authentik_db_user }}"
AUTHENTIK_POSTGRESQL__PASSWORD: "{{ authentik_db_password }}"
# AUTHENTIK_ERROR_REPORTING__ENABLED: "true"
# WORKERS: 2
volumes:
- {{ authentik_volume_media }}:/media
- {{ authentik_volume_templates }}:/templates
- {{ authentik_volume_geoip }}:/geoip
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
2022-09-16 16:07:01 +02:00
env_file:
- {{ authentik_volume_config }}/env.authentik.conf
ports:
- "0.0.0.0:{{ authentik_port_http }}:9000"
- "0.0.0.0:{{ authentik_port_https }}:9443"
worker:
image: ghcr.io/goauthentik/server:{{ authentik_image_version }}
restart: unless-stopped
command: worker
environment:
2022-09-16 22:34:37 +02:00
AUTHENTIK_REDIS__HOST: redis
AUTHENTIK_POSTGRESQL__HOST: postgresql
2022-09-16 16:07:01 +02:00
AUTHENTIK_POSTGRESQL__NAME: "{{ authentik_db }}"
AUTHENTIK_POSTGRESQL__USER: "{{ authentik_db_user }}"
AUTHENTIK_POSTGRESQL__PASSWORD: "{{ authentik_db_password }}"
# AUTHENTIK_ERROR_REPORTING__ENABLED: "true"
# This is optional, and can be removed. If you remove this, the following will happen
# - The permissions for the /media folders aren't fixed, so make sure they are 1000:1000
# - The docker socket can't be accessed anymore
user: root
volumes:
- {{ authentik_volume_media }}:/media
- {{ authentik_volume_certs }}:/certs
- /var/run/docker.sock:/var/run/docker.sock
- {{ authentik_volume_templates }}:/templates
- {{ authentik_volume_geoip }}:/geoip
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
2022-09-16 16:07:01 +02:00
env_file:
- {{ authentik_volume_config }}/env.authentik.conf
{% if authentik_geoip_container %}
2022-09-16 16:07:01 +02:00
geoipupdate:
image: "maxmindinc/geoipupdate:latest"
volumes:
- "{{ authentik_volume_geoip }}:/usr/share/GeoIP"
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
2022-09-16 16:07:01 +02:00
env_file:
- {{ authentik_volume_config }}/env.authentik.conf
{% endif %}