Created
October 10, 2022 14:18
-
-
Save McEnos/37709b917072f7c6a89487e7993d3579 to your computer and use it in GitHub Desktop.
sample docker compose for keycloak, postgres and pgadmin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version: '3.8' | |
| services: | |
| postgres: | |
| container_name: postgres-db | |
| image: postgres | |
| command: -c ssl=off | |
| environment: | |
| POSTGRES_USER: ${POSTGRES_USER:-postgres} | |
| POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-root} | |
| PGDATA: /data/postgres | |
| volumes: | |
| - postgres:/data/postgres | |
| ports: | |
| - "5432:5432" | |
| networks: | |
| - postgres | |
| restart: unless-stopped | |
| pgadmin: | |
| container_name: pgadmin | |
| image: dpage/pgadmin4 | |
| environment: | |
| PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL:[email protected]} | |
| PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD:-admin} | |
| PGADMIN_CONFIG_SERVER_MODE: 'False' | |
| volumes: | |
| - pgadmin:/var/lib/pgadmin | |
| ports: | |
| - "${PGADMIN_PORT:-5050}:80" | |
| networks: | |
| - postgres | |
| restart: unless-stopped | |
| keycloak: | |
| image: quay.io/keycloak/keycloak:latest | |
| container_name: keycloak | |
| restart: unless-stopped | |
| entrypoint: /opt/keycloak/bin/kc.sh start-dev --auto-build | |
| networks: | |
| - postgres | |
| volumes: | |
| - keycloak:/var/lib/keycloak/data | |
| environment: | |
| KC_DB: postgres | |
| KC_DB_SCHEMA: public | |
| KC_DB_USERNAME: postgres | |
| KC_DB_PASSWORD: root | |
| KEYCLOAK_ADMIN: admin | |
| KEYCLOAK_ADMIN_PASSWORD: admin | |
| KC_DB_URL_DATABASE: keycloak | |
| KC_DB_URL_HOST: postgres-db | |
| KC_DB_URL_PORT: 5432 | |
| KC_HOSTNAME_STRICT: false | |
| ports: | |
| - 8181:8080 | |
| depends_on: | |
| - postgres | |
| networks: | |
| postgres: | |
| driver: bridge | |
| volumes: | |
| postgres: | |
| pgadmin: | |
| keycloak: | |
| #https://belowthemalt.com/2021/06/09/run-postgresql-and-pgadmin-in-docker-for-local-development-using-docker-compose/ | |
| #https://github.com/keycloak/keycloak/discussions/13516 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment