File tree Expand file tree Collapse file tree 4 files changed +35
-0
lines changed Expand file tree Collapse file tree 4 files changed +35
-0
lines changed Original file line number Diff line number Diff line change 1+ environments /db.env
Original file line number Diff line number Diff line change 1+ version : ' 1'
2+
3+ services :
4+ keycloak-db :
5+ image : postgres:15
6+ container_name : keycloak-db
7+ hostname : keycloak-db
8+ restart : unless-stopped
9+ env_file :
10+ - ./environments/db.env
11+ volumes :
12+ - ' ./environments/db-init.sh:/docker-entrypoint-initdb.d/db-init.sh'
13+ - ' postgres-data:/var/lib/postgresql/data'
14+
15+ volumes :
16+ postgres-data :
17+ name : keycloak-postgres-data
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ set -e
4+ set -u
5+
6+ psql -v ON_ERROR_STOP=1 --username " $POSTGRES_USER " " $POSTGRES_DB " << -EOSQL
7+ CREATE USER "$KEYCLOAK_DB_USER " WITH password '$KEYCLOAK_DB_PASS ';
8+ CREATE DATABASE "$KEYCLOAK_DB_NAME ";
9+ ALTER DATABASE "$KEYCLOAK_DB_NAME " OWNER TO "$KEYCLOAK_DB_USER "
10+ EOSQL
Original file line number Diff line number Diff line change 1+ POSTGRES_DB=postgres
2+ POSTGRES_USER=postgres
3+ POSTGRES_PASSWORD=postgres
4+
5+ KEYCLOAK_DB_NAME=keycloak
6+ KEYCLOAK_DB_USER=keycloak
7+ KEYCLOAK_DB_PASS=keycloak
You can’t perform that action at this time.
0 commit comments