version: "3.8"
services:
mysql:
image: mysql:latest
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: keycloak_db
MYSQL_USER: dbuser
MYSQL_PASSWORD: 12345678
ports:
- "3306:3306"
healthcheck:
test: [ "CMD", "mysqladmin", "ping", "-h", "localhost" ]
timeout: 20s
retries: 10
interval: 10s
keycloak:
image: quay.io/keycloak/keycloak:latest
ports:
- "8080:8080"
depends_on:
mysql:
condition: service_healthy
environment:
KC_DB_URL: jdbc:mysql://mysql:3306/keycloak_db
KC_DB_USERNAME: dbuser
KC_DB_PASSWORD: 12345678
KEYCLOAK_ADMIN: admin
KEYCLOAK_ADMIN_PASSWORD: admin
KC_PROXY: passthrough
KC_HOSTNAME: localhost:9000
KC_HOSTNAME_ADMIN_URL: http://localhost:9000
KC_HTTP_ENABLED: true
KC_HOSTNAME_STRICT_BACKCHANNEL: true
KC_HOSTNAME_STRICT_HTTPS: false
KC_HOSTNAME_STRICT: false