Files
ntbops-ansible/roles/authentik/templates/compose.yaml.j2
T

52 lines
1.7 KiB
Django/Jinja

services:
postgresql:
image: {{ authentik_postgres_image }}
restart: unless-stopped
environment:
POSTGRES_DB: authentik
POSTGRES_USER: authentik
POSTGRES_PASSWORD: ${PG_PASS}
volumes:
- ./postgresql:/var/lib/postgresql/data
redis:
image: {{ authentik_redis_image }}
restart: unless-stopped
server:
image: {{ authentik_image }}
restart: unless-stopped
command: server
env_file: .env
{% if authentik_routing_mode in ["host", "traefik_file"] %}
ports:
- "{{ nbops_traefik_file_bind_address if authentik_routing_mode == 'traefik_file' else '0.0.0.0' }}:{{ authentik_http_port }}:9000"
- "{{ nbops_traefik_file_bind_address if authentik_routing_mode == 'traefik_file' else '0.0.0.0' }}:{{ authentik_https_port }}:9443"
{% endif %}
{% if authentik_routing_mode == "traefik" %}
# internal HTTP service port: 9000; not published on the Docker host
labels:
- traefik.enable=true
- traefik.http.routers.authentik.rule=Host(`{{ authentik_domain }}`)
- traefik.http.routers.authentik.entrypoints={{ authentik_traefik_entrypoint }}
- traefik.http.routers.authentik.tls={{ authentik_traefik_tls | bool | ternary('true', 'false') }}
- traefik.http.services.authentik.loadbalancer.server.port=9000
networks:
- default
- {{ authentik_traefik_network }}
{% endif %}
depends_on:
- postgresql
- redis
worker:
image: {{ authentik_image }}
restart: unless-stopped
command: worker
env_file: .env
depends_on:
- postgresql
- redis
{% if authentik_routing_mode == "traefik" %}
networks:
{{ authentik_traefik_network }}:
external: true
{% endif %}