Update Docker & Kubernetes/Docker/Docker Compose/Keycloak.md

This commit is contained in:
2024-07-12 02:38:05 -06:00
parent 0b1eef44cd
commit 04d50fe6bc

View File

@ -21,6 +21,11 @@
POSTGRES_DB: ${POSTGRES_DB} POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER} POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
healthcheck:
test: ["CMD-SHELL", "pg_isready -U keycloak"]
interval: 10s
timeout: 5s
retries: 5
networks: networks:
docker_network: docker_network:
ipv4_address: 192.168.5.3 ipv4_address: 192.168.5.3
@ -28,6 +33,9 @@
keycloak: keycloak:
image: quay.io/keycloak/keycloak:23.0.6 image: quay.io/keycloak/keycloak:23.0.6
command: start command: start
volumes:
- /srv/containers/keycloak/themes:/opt/keycloak/themes
- /srv/containers/keycloak/base-theme:/opt/keycloak/themes/base
environment: environment:
TZ: America/Denver # (1) TZ: America/Denver # (1)
KC_PROXY_ADDRESS_FORWARDING: true # (2) KC_PROXY_ADDRESS_FORWARDING: true # (2)
@ -42,6 +50,7 @@
KC_DB_URL_HOST: postgres KC_DB_URL_HOST: postgres
KC_DB_URL_PORT: 5432 KC_DB_URL_PORT: 5432
KC_DB_URL_DATABASE: ${POSTGRES_DB} KC_DB_URL_DATABASE: ${POSTGRES_DB}
KC_TRANSACTION_RECOVERY: true
KEYCLOAK_ADMIN: ${KEYCLOAK_ADMIN} KEYCLOAK_ADMIN: ${KEYCLOAK_ADMIN}
KEYCLOAK_ADMIN_PASSWORD: ${KEYCLOAK_ADMIN_PASSWORD} KEYCLOAK_ADMIN_PASSWORD: ${KEYCLOAK_ADMIN_PASSWORD}
# KC_HOSTNAME_DEBUG: true # (6) # KC_HOSTNAME_DEBUG: true # (6)
@ -49,8 +58,10 @@
ports: ports:
- 8080:8080 - 8080:8080
restart: always restart: always
depends_on: depends_on:
- postgres postgres:
condition: service_healthy
networks: networks:
docker_network: docker_network:
ipv4_address: 192.168.5.2 ipv4_address: 192.168.5.2
@ -61,7 +72,6 @@
name: docker_network name: docker_network
docker_network: docker_network:
external: true external: true
``` ```
1. This sets the timezone of the Keycloak server to your timezone. This is not really necessary according to the official documentation, however I just like to add it to all of my containers as a baseline environment variable to add 1. This sets the timezone of the Keycloak server to your timezone. This is not really necessary according to the official documentation, however I just like to add it to all of my containers as a baseline environment variable to add