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

44 lines
1.2 KiB
YAML
Raw Normal View History

2024-02-05 18:44:13 +01:00
{% import 'macro/postgres.j2' as pg with context %}
2022-09-25 14:04:21 +02:00
---
version: '3.9'
services:
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:
2024-02-05 18:44:13 +01:00
pg:
2022-10-27 00:55:39 +02:00
condition: service_healthy
2022-09-25 14:04:21 +02:00
environment:
- "KC_DB=postgres"
2024-02-20 19:45:32 +01:00
- "KC_DB_URL_HOST=pg"
2022-09-25 14:04:21 +02:00
- "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"
2024-01-22 18:56:17 +01:00
- "traefik.docker.network=${COMPOSE_PROJECT_NAME}_default"
2022-09-25 14:04:21 +02:00
- "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
2024-02-05 18:44:13 +01:00
{{ pg.postgres("pg", auth.db.user, auth.db.password, auth.db.name, ["backend"]) }}
2022-09-25 14:04:21 +02:00
networks:
2024-02-05 18:44:13 +01:00
postgres:
internal: true
2022-09-25 14:04:21 +02:00
backend:
internal: true
volumes:
pg_data:
...