mancala/apps/compose.yaml
Halit Aksoy 7c99a76af7 feat(keycloak): add Keycloak with guest login extension
- Custom authenticator creates and logs in a guest user when the
  authorization request has guest=true; other requests get the login form
- Scheduled task removes guests with no remaining sessions
- Realm export with mancala-web PKCE client, guest role and guest-aware
  browser flow (verify profile disabled so guests are not asked for details)
- Dockerfile building the extension into a Keycloak 26.7.5 image
- Keycloak and Postgres in compose; nginx proxies auth.playmancala.app
  and rate limits the auth endpoint
- Integration tests run the extension and realm in a Keycloak container
2026-10-14 01:46:48 +03:00

45 lines
1.4 KiB
YAML

services:
backend:
image: jhalitaksoy/mancala-backend:latest
ports:
- "5000:6000"
frontend:
image: jhalitaksoy/mancala-frontend:latest
ports:
- "3000:3000"
keycloak-db:
image: postgres:17.6
environment:
POSTGRES_DB: keycloak
POSTGRES_USER: keycloak
POSTGRES_PASSWORD: ${KEYCLOAK_DB_PASSWORD:?set KEYCLOAK_DB_PASSWORD in apps/.env}
volumes:
- keycloak-db:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U keycloak -d keycloak"]
interval: 5s
timeout: 5s
retries: 10
keycloak:
image: jhalitaksoy/mancala-keycloak:latest
build: ./keycloak
environment:
KC_DB_URL: jdbc:postgresql://keycloak-db:5432/keycloak
KC_DB_USERNAME: keycloak
KC_DB_PASSWORD: ${KEYCLOAK_DB_PASSWORD}
# Public URL of Keycloak; https://auth.playmancala.app in production
KC_HOSTNAME: ${KEYCLOAK_HOSTNAME:-http://localhost:8080}
KC_HTTP_ENABLED: "true"
KC_PROXY_HEADERS: xforwarded
# Only used to create the master admin on the very first start
KC_BOOTSTRAP_ADMIN_USERNAME: ${KEYCLOAK_ADMIN_USERNAME:-admin}
KC_BOOTSTRAP_ADMIN_PASSWORD: ${KEYCLOAK_ADMIN_PASSWORD:?set KEYCLOAK_ADMIN_PASSWORD in apps/.env}
ports:
- "127.0.0.1:8080:8080"
depends_on:
keycloak-db:
condition: service_healthy
volumes:
keycloak-db: