chore: add healthcheck to authentik and wait for it after deployment

This commit is contained in:
Bert-Jan Fikse 2026-01-14 17:36:52 +01:00
parent 7f639e8191
commit fe31369f8c
Signed by: bert-jan
GPG key ID: C1E0AB516AC16D1A
2 changed files with 9 additions and 1 deletions

View file

@ -51,4 +51,6 @@
community.docker.docker_compose_v2: community.docker.docker_compose_v2:
project_src: "{{ authentik_docker_compose_dir }}" project_src: "{{ authentik_docker_compose_dir }}"
state: present state: present
recreate: "{{ blueprints_changed | ternary('always', 'auto') }}" recreate: "{{ blueprints_changed | ternary('always', 'auto') }}"
wait: true
wait_timeout: 300

View file

@ -21,6 +21,12 @@ services:
image: {{ authentik_image }} image: {{ authentik_image }}
restart: unless-stopped restart: unless-stopped
command: server command: server
healthcheck:
test: ["CMD", "ak", "healthcheck"]
start_period: 30s
interval: 10s
retries: 5
timeout: 5s
environment: environment:
AUTHENTIK_SECRET_KEY: {{ authentik_secret_key }} AUTHENTIK_SECRET_KEY: {{ authentik_secret_key }}
AUTHENTIK_POSTGRESQL__HOST: postgres AUTHENTIK_POSTGRESQL__HOST: postgres