File tree Expand file tree Collapse file tree 3 files changed +75
-1
lines changed
Expand file tree Collapse file tree 3 files changed +75
-1
lines changed Original file line number Diff line number Diff line change 1+ # Keycloak Admin Credentials
2+ SERVICE_USER_ADMIN = admin
3+ SERVICE_PASSWORD_ADMIN = admin_password
4+
5+ # Database Credentials
6+ SERVICE_USER_DATABASE = keycloak_db
7+ SERVICE_PASSWORD_64_DATABASE = keycloak_db_password
8+ POSTGRESQL_DATABASE = keycloak
9+
10+ # Service Configuration
11+ SERVICE_FQDN_KEYCLOAK = localhost
12+ SERVICE_FQDN_KEYCLOAK_8080 = localhost:8080
13+
14+ # Keycloak Settings
15+ KC_HTTP_ENABLED = true
16+ KC_HEALTH_ENABLED = true
17+ KC_PROXY_HEADERS = xforwarded
18+
19+ # Other Settings
20+ TIMEZONE = UTC
Original file line number Diff line number Diff line change @@ -9,6 +9,6 @@ FROM quay.io/keycloak/keycloak:26.1.2
99WORKDIR /opt/keycloak
1010COPY --from=build /app/dist_keycloak/keycloak-theme-for-kc-all-other-versions.jar /opt/keycloak/providers/
1111
12- RUN /opt/keycloak/bin/kc.sh build
12+ RUN /opt/keycloak/bin/kc.sh build --db=postgres --health-enabled=true --features=docker
1313
1414ENTRYPOINT ["/opt/keycloak/bin/kc.sh" , "start" , "--optimized" ]
Original file line number Diff line number Diff line change 1+ services :
2+ keycloak :
3+ image : " ghcr.io/solvro/solvro-auth:latest"
4+ build :
5+ dockerfile : Dockerfile
6+ environment :
7+ - SERVICE_FQDN_KEYCLOAK_8080
8+ - " TZ=${TIMEZONE:-UTC}"
9+ - " KC_BOOTSTRAP_ADMIN_USERNAME=${SERVICE_USER_ADMIN}"
10+ - " KC_BOOTSTRAP_ADMIN_PASSWORD=${SERVICE_PASSWORD_ADMIN}"
11+ - KC_DB=postgres
12+ - " KC_DB_USERNAME=${SERVICE_USER_DATABASE}"
13+ - " KC_DB_PASSWORD=${SERVICE_PASSWORD_64_DATABASE}"
14+ - KC_DB_URL_PORT=5432
15+ - " KC_DB_URL=jdbc:postgresql://postgres/${POSTGRESQL_DATABASE:-keycloak}"
16+ - " KC_HOSTNAME=${SERVICE_FQDN_KEYCLOAK}"
17+ - " KC_HTTP_ENABLED=${KC_HTTP_ENABLED:-true}"
18+ - " KC_HEALTH_ENABLED=${KC_HEALTH_ENABLED:-true}"
19+ - " KC_PROXY_HEADERS=${KC_PROXY_HEADERS:-xforwarded}"
20+ volumes :
21+ - " keycloak-data:/opt/keycloak/data"
22+ ports :
23+ - " 8080:8080"
24+ depends_on :
25+ postgres :
26+ condition : service_healthy
27+ healthcheck :
28+ test :
29+ - CMD-SHELL
30+ - " exec 3<>/dev/tcp/127.0.0.1/9000; echo -e 'GET /health/ready HTTP/1.1\r\n Host: localhost:9000\r\n Connection: close\r\n\r\n ' >&3;cat <&3 | grep -q '\" status\" : \" UP\" ' && exit 0 || exit 1"
31+ interval : 5s
32+ timeout : 20s
33+ retries : 10
34+ postgres :
35+ image : " postgres:16-alpine"
36+ volumes :
37+ - " keycloak-postgresql-data:/var/lib/postgresql/data"
38+ environment :
39+ - " POSTGRES_USER=${SERVICE_USER_DATABASE}"
40+ - " POSTGRES_PASSWORD=${SERVICE_PASSWORD_64_DATABASE}"
41+ - " POSTGRES_DB=${POSTGRESQL_DATABASE:-keycloak}"
42+ healthcheck :
43+ test :
44+ - CMD-SHELL
45+ - " pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"
46+ interval : 5s
47+ timeout : 20s
48+ retries : 10
49+
50+ volumes :
51+ keycloak-data :
52+ name : " keycloak-data"
53+ keycloak-postgresql-data :
54+ name : " keycloak-postgresql-data"
You can’t perform that action at this time.
0 commit comments