Skip to content

Instantly share code, notes, and snippets.

@michimau
Last active March 20, 2022 08:34
Show Gist options
  • Save michimau/644049789fe1ec60eb02ae44553bf592 to your computer and use it in GitHub Desktop.
Save michimau/644049789fe1ec60eb02ae44553bf592 to your computer and use it in GitHub Desktop.
keycloak-x deploy recipe
version: '2'
volumes:
keycloak_postgres_data:
keycloak_postgres_scripts:
services:
keycloak:
image: quay.io/keycloak/keycloak:17.0.0
#init: true
ports:
- 8080:8080
environment:
TZ: Europe/Copenhagen
KEYCLOAK_ADMIN: keycloak
KEYCLOAK_ADMIN_PASSWORD: password
command: start --http-enabled=true --http-port=8080 --http-host=0.0.0.0 --hostname=keycloak.devel5cph.eionet.europa.eu --hostname-strict-https=false --db-url-host=pg-0 -Dkc.db=postgres --db-username=keycloak --db-password=password --db-schema=public --db-url-database=keycloak --proxy=passthrough -Dkeycloak.profile.feature.upload_scripts=enabled --cache=ispn --cache-stack=udp --auto-build
pg-0:
image: docker.io/bitnami/postgresql-repmgr:14.2.0
#ports:
# - 5430:5432
#volumes:
#- pg_0_data:/bitnami/postgresql
#- keycloak_postgres_init_scripts:/docker-entrypoint-initdb.d
environment:
- POSTGRESQL_POSTGRES_PASSWORD=adminpassword
- POSTGRESQL_USERNAME=keycloak
- POSTGRESQL_PASSWORD=password
- POSTGRESQL_DATABASE=keycloak
- REPMGR_PASSWORD=repmgrpassword
- REPMGR_PRIMARY_HOST=pg-0
- REPMGR_PRIMARY_PORT=5432
- REPMGR_PARTNER_NODES=pg-0,pg-1:5432
- REPMGR_NODE_NAME=pg-0
- REPMGR_NODE_NETWORK_NAME=pg-0
- REPMGR_PORT_NUMBER=5432
pg-1:
image: docker.io/bitnami/postgresql-repmgr:14.2.0
#ports:
# - 5431:5432
#volumes:
#- pg_1_data:/bitnami/postgresql
environment:
- POSTGRESQL_POSTGRES_PASSWORD=adminpassword
- POSTGRESQL_USERNAME=keycloak
- POSTGRESQL_PASSWORD=password
- POSTGRESQL_DATABASE=keycloak
- REPMGR_PASSWORD=repmgrpassword
- REPMGR_PRIMARY_HOST=pg-0
- REPMGR_PRIMARY_PORT=5432
- REPMGR_PARTNER_NODES=pg-0,pg-1:5432
- REPMGR_NODE_NAME=pg-1
- REPMGR_NODE_NETWORK_NAME=pg-1
- REPMGR_PORT_NUMBER=5432
pg-2:
image: docker.io/bitnami/postgresql-repmgr:14.2.0
#ports:
# - 5431:5432
#volumes:
#- pg_2_data:/bitnami/postgresql
environment:
- POSTGRESQL_POSTGRES_PASSWORD=adminpassword
- POSTGRESQL_USERNAME=keycloak
- POSTGRESQL_PASSWORD=password
- POSTGRESQL_DATABASE=keycloak
- REPMGR_PASSWORD=repmgrpassword
- REPMGR_PRIMARY_HOST=pg-0
- REPMGR_PRIMARY_PORT=5432
- REPMGR_PARTNER_NODES=pg-0,pg-2:5432
- REPMGR_NODE_NAME=pg-2
- REPMGR_NODE_NETWORK_NAME=pg-2
- REPMGR_PORT_NUMBER=5432
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment