infrastructure/ansible/plays/services/keycloak/docker-compose.yaml

55 lines
1.4 KiB
YAML
Raw Normal View History

2022-09-25 14:04:21 +02:00
---
version: '3.9'
services:
postgres:
2023-08-12 03:17:32 +02:00
image: postgres:15
2022-09-25 14:04:21 +02:00
restart: always
environment:
- "POSTGRES_DB={{ auth.db.name }}"
- "POSTGRES_USER={{ auth.db.user }}"
- "POSTGRES_PASSWORD={{ auth.db.password }}"
volumes:
- pg_data:/var/lib/postgresql/data
networks:
- backend
2022-10-27 00:55:39 +02:00
healthcheck:
2024-01-10 09:00:44 +01:00
test: ["CMD-SHELL", "pg_isready", "-U", "{{ auth.db.user }}"]
2022-10-27 00:55:39 +02:00
interval: 10s
timeout: 5s
retries: 5
2022-09-25 14:04:21 +02:00
keycloak:
2023-04-06 19:13:09 +02:00
image: registry.tobiasmanske.de/keycloak:main
2022-09-25 14:04:21 +02:00
command: start
depends_on:
2022-10-27 00:55:39 +02:00
postgres:
condition: service_healthy
2022-09-25 14:04:21 +02:00
environment:
- "KC_DB=postgres"
- "KC_DB_URL_HOST=postgres"
- "KC_DB_URL_DATABASE={{ auth.db.name }}"
- "KC_DB_USERNAME={{ auth.db.user }}"
- "KC_DB_PASSWORD={{ auth.db.password }}"
- "KEYCLOAK_ADMIN={{ auth.keycloak.user }}"
- "KEYCLOAK_ADMIN_PASSWORD={{ auth.keycloak.password }}"
- "KC_PROXY=edge"
- "KC_HOSTNAME=auth.tobiasmanske.de"
labels:
- "traefik.enable=true"
- "traefik.http.routers.keycloak.rule=Host(`auth.tobiasmanske.de`)"
- "traefik.http.routers.keycloak.entryPoints=websecure"
- "traefik.http.services.keycloak.loadbalancer.server.port=8080"
restart: always
networks:
- backend
2023-08-12 03:22:22 +02:00
- default # keycloak needs to talk to social logins
2022-09-25 14:04:21 +02:00
networks:
backend:
internal: true
volumes:
pg_data:
...