Skip to content

Commit

Permalink
Replace MySQL Keycloak DB with Postgres
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Franchin committed Mar 12, 2023
1 parent 72130b2 commit b2fba9f
Show file tree
Hide file tree
Showing 3 changed files with 775 additions and 776 deletions.
23 changes: 11 additions & 12 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,26 @@ services:
healthcheck:
test: echo 'db.stats().ok' | mongosh localhost:27017/moviesdb --quiet

mysql:
image: mysql:5.7.41
container_name: mysql
postgres:
image: postgres:15.2
container_name: postgres
ports:
- "3306:3306"
- "5432:5432"
environment:
- MYSQL_DATABASE=keycloak
- MYSQL_USER=keycloak
- MYSQL_PASSWORD=password
- MYSQL_ROOT_PASSWORD=root_password
- POSTGRES_DB=keycloak
- POSTGRES_USER=keycloak
- POSTGRES_PASSWORD=password
healthcheck:
test: "mysqladmin ping -u root -p$${MYSQL_ROOT_PASSWORD}"
test: "pg_isready -U postgres"

keycloak:
image: quay.io/keycloak/keycloak:21.0.1
container_name: keycloak
environment:
- KEYCLOAK_ADMIN=admin
- KEYCLOAK_ADMIN_PASSWORD=admin
- KC_DB=mysql
- KC_DB_URL_HOST=mysql
- KC_DB=postgres
- KC_DB_URL_HOST=postgres
- KC_DB_URL_DATABASE=keycloak
- KC_DB_USERNAME=keycloak
- KC_DB_PASSWORD=password
Expand All @@ -39,6 +38,6 @@ services:
- "8080:8080"
command: start-dev
depends_on:
- mysql
- postgres
healthcheck:
test: "curl -f http://localhost:8080/health/ready || exit 1"
Loading

0 comments on commit b2fba9f

Please sign in to comment.