Jafner.net/homelab/fighter/config/keycloak/docker-compose.yml

101 lines
2.8 KiB
YAML
Raw Normal View History

2024-02-15 00:16:48 -08:00
version: '3.0'
2022-10-12 15:31:44 -07:00
services:
2024-01-08 11:44:38 -08:00
keycloak:
image: quay.io/keycloak/keycloak:23.0
container_name: keycloak_keycloak
networks:
keycloak:
aliases:
- keycloak
web:
aliases:
- keycloak
restart: "no"
healthcheck:
test: ["CMD-SHELL", "exec 3<>/dev/tcp/127.0.0.1/8080;echo -e \"GET /health/ready HTTP/1.1\r\nhost: http://localhost\r\nConnection: close\r\n\r\n\" >&3;grep \"HTTP/1.1 200 OK\" <&3"]
interval: 20s
timeout: 5s
retries: 5
depends_on:
- postgres
command: start
env_file:
2024-02-15 00:16:48 -08:00
- path: ./keycloak.env
required: true
- path: ./keycloak_secrets.env
required: false
2024-01-08 11:44:38 -08:00
labels:
traefik.http.routers.keycloak.rule: Host(`keycloak.jafner.net`)
traefik.http.routers.keycloak.tls.certresolver: lets-encrypt
traefik.http.routers.keycloak.middlewares: keycloak-redirect
traefik.http.services.keycloak.loadbalancer.server.port: 8080
traefik.http.middlewares.keycloak-redirect.redirectregex.regex: ^https:\\/\\/([^\\//]+)\\/?$$"
traefik.http.middlewares.keycloak-redirect.redirectregex.replacement: https://$$1/admin"
2022-10-17 08:44:09 -07:00
forwardauth:
image: mesosphere/traefik-forward-auth:3.1.0
2022-10-17 08:44:09 -07:00
container_name: keycloak_forwardauth
networks:
web:
2022-10-17 10:09:11 -07:00
aliases:
- forwardauth
2022-10-17 08:44:09 -07:00
restart: "no"
2023-04-06 12:37:10 -07:00
depends_on:
keycloak:
condition: service_healthy
2022-11-01 00:33:30 -07:00
env_file:
2024-02-15 00:16:48 -08:00
- path: ./forwardauth.env
required: true
- path: ./forwardauth_secrets.env
required: false
2022-10-17 08:44:09 -07:00
labels:
- "traefik.enable=false"
2022-10-17 08:44:09 -07:00
- "traefik.http.routers.forwardauth.rule=Path(`/_oauth`)"
- "traefik.http.routers.forwardauth.tls.certresolver=lets-encrypt"
2023-01-11 21:09:25 -08:00
forwardauth-privileged:
image: mesosphere/traefik-forward-auth:3.1.0
container_name: keycloak_forwardauth-privileged
2023-01-24 21:36:40 -08:00
command: "./traefik-forward-auth --whitelist=jafner425@gmail.com"
2023-01-11 21:09:25 -08:00
networks:
web:
aliases:
2023-01-11 21:49:05 -08:00
- forwardauth-privileged
2023-01-11 21:09:25 -08:00
restart: "no"
2023-04-06 12:37:10 -07:00
depends_on:
keycloak:
condition: service_healthy
2023-01-11 21:09:25 -08:00
env_file:
2024-02-15 00:16:48 -08:00
- path: ./forwardauth-privileged.env
required: true
- path: ./forwardauth-privileged_secrets.env
required: false
2023-01-11 21:09:25 -08:00
labels:
- "traefik.enable=false"
2023-01-11 21:56:25 -08:00
- "traefik.http.routers.forwardauth-privileged.rule=Path(`/_oauth`)"
2023-01-11 21:09:25 -08:00
- "traefik.http.routers.forwardauth-privileged.tls.certresolver=lets-encrypt"
postgres:
2024-01-05 17:42:09 -08:00
image: postgres:15
container_name: keycloak_postgres
networks:
- keycloak
env_file:
2024-02-15 00:16:48 -08:00
- path: ./postgres.env
required: true
- path: ./postgres_secrets.env
required: false
2024-01-05 17:42:09 -08:00
- postgres.env
- postgres_secrets.env
volumes:
- postgres_data:/var/lib/postgresql/data
2022-10-12 15:31:44 -07:00
networks:
web:
external: true
keycloak:
2024-01-04 11:32:56 -08:00
volumes:
postgres_data: