Skip to content

Commit

Permalink
Merge pull request #243 from serguun42/implement-keycloak
Browse files Browse the repository at this point in the history
Add Keycloak and Keycloak Postgres instances
  • Loading branch information
serguun42 authored Dec 8, 2023
2 parents 4de5099 + 8f0f26f commit ba1f68b
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 0 deletions.
43 changes: 43 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,46 @@ services:
restart: always
volumes:
- ${FRONTEND_PUBLISH_PATH}:/usr/src/app/mount

mss-keycloak:
container_name: mss-keycloak
image: quay.io/keycloak/keycloak:latest
restart: on-failure
environment:
KEYCLOAK_ADMIN: ${KEYCLOAK_ADMIN}
KEYCLOAK_ADMIN_PASSWORD: ${KEYCLOAK_ADMIN_PASSWORD}
KC_DB: postgres
KC_DB_URL: jdbc:postgresql://mss-keycloak-postgres:5432/${KEYCLOAK_POSTGRES_DB}
KC_DB_USERNAME: ${KEYCLOAK_POSTGRES_USER}
KC_DB_PASSWORD: ${KEYCLOAK_POSTGRES_PASSWORD}
KC_HOSTNAME: mirea.xyz
KC_HOSTNAME_PORT: ${KEYCLOAK_PUBLISH_PORT}
KC_HOSTNAME_STRICT_BACKCHANNEL: "true"
KC_HTTP_ENABLED: "true"
KC_LOG_LEVEL: warn
KC_PROXY: none
ports:
- 127.0.0.1:${KEYCLOAK_PUBLISH_PORT}:8443
depends_on:
- mss-keycloak-postgres
volumes:
- ./keycloak/keycloak.conf:/opt/keycloak/conf/keycloak.conf
- ${KEYCLOAK_PUBLIC_CERT_FILE_PATH}:/opt/keycloak/conf/public.crt:ro
- ${KEYCLOAK_PRIVATE_KEY_FILE_PATH}:/opt/keycloak/conf/private.key:ro
command:
- start
- --https-certificate-file=/opt/keycloak/conf/public.crt
- --https-certificate-key-file=/opt/keycloak/conf/private.key

mss-keycloak-postgres:
container_name: mss-keycloak-postgres
image: postgres:16-alpine
restart: on-failure
environment:
PGDATA: "/var/lib/postgresql/data/pgdata"
POSTGRES_DB: ${KEYCLOAK_POSTGRES_DB}
POSTGRES_USER: ${KEYCLOAK_POSTGRES_USER}
POSTGRES_PASSWORD: ${KEYCLOAK_POSTGRES_PASSWORD}
volumes:
- mss-keycloak-postgres:/var/lib/postgresql/data
- ./keycloak/postgresql.conf:/etc/postgresql/postgresql.conf
1 change: 1 addition & 0 deletions keycloak/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.dev*
1 change: 1 addition & 0 deletions keycloak/keycloak.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
quarkus.transaction-manager.enable-recovery=true
7 changes: 7 additions & 0 deletions keycloak/postgresql.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# -----------------------------
# PostgreSQL configuration file
# -----------------------------

# From sample /usr/local/share/postgresql/postgresql.conf.sample

listen_addresses = '*'

0 comments on commit ba1f68b

Please sign in to comment.