Created
July 6, 2023 08:56
-
-
Save sashokbg/4671a6e2d145bce8eb85aeabf7a973bb to your computer and use it in GitHub Desktop.
Docker Compose Config for Inter Container AND Host Communication
This file contains 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
services: | |
api: | |
image: <image> | |
ports: | |
- 8080:8080 | |
depends_on: | |
keycloak: | |
condition: service_healthy | |
networks: | |
- my-net | |
postgres: | |
image: postgres | |
environment: | |
POSTGRES_PASSWORD: root | |
POSTGRES_USER: postgres | |
ports: | |
- 5432:5432 | |
volumes: | |
- ./init-db.sql:/docker-entrypoint-initdb.d/init-db.sql | |
networks: | |
- my-net | |
keycloak: | |
image: quay.io/keycloak/keycloak:latest | |
volumes: | |
- keycloak:/opt/keycloak/data | |
- ./master-realm.json:/opt/keycloak/realm-export.json | |
- ./keycloak_config/js-policies/target/js-policies.jar:/opt/keycloak/providers/js-policies.jar | |
- ./realm-export-bo.json:/opt/keycloak/realm-export-bo.json | |
- ./realm-export-front.json:/opt/keycloak/realm-export-front.json | |
ports: | |
- 9900:9900 | |
- 8787:8787 | |
environment: | |
KEYCLOAK_ADMIN: admin | |
KEYCLOAK_ADMIN_PASSWORD: admin | |
KEYCLOAK_LOGLEVEL: DEBUG | |
DEBUG: true | |
DEBUG_PORT: '*:8787' | |
entrypoint: sh | |
command: | |
- -c | |
- | | |
/opt/keycloak/bin/kc.sh import --file /opt/keycloak/realm-export.json && | |
/opt/keycloak/bin/kc.sh import --file /opt/keycloak/realm-export-bo.json && | |
/opt/keycloak/bin/kc.sh import --file /opt/keycloak/realm-export-front.json && | |
/opt/keycloak/bin/kc.sh start-dev --http-port=9900 #--log-level=DEBUG | |
healthcheck: | |
test: [ "CMD", "curl", "-f", "http://localhost:9900" ] | |
interval: 10s | |
timeout: 5s | |
retries: 3 | |
start_period: 40s | |
networks: | |
- my-net | |
redis: | |
profiles: | |
- redis | |
image: redis | |
ports: | |
- 6379:6379 | |
volumes: | |
- ./redis-conf/:/usr/local/etc/redis | |
command: | |
- redis-server | |
- /usr/local/etc/redis/redis.conf | |
networks: | |
- my-net | |
redis_gui: | |
profiles: | |
- redis | |
image: redislabs/redisinsight | |
ports: | |
- 8001:8001 | |
networks: | |
- my-net | |
volumes: | |
keycloak: | |
networks: | |
my-net: | |
ipam: | |
config: | |
- subnet: 172.28.0.0/16 | |
ip_range: 172.28.0.2/16 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment