-
-
Save malys/fc9777197a3d13a5a23a8a4d00a17e41 to your computer and use it in GitHub Desktop.
[Kong Docker] #kong #docker # docker-compose
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
# Mount wait-for-it https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh | |
version: "3" | |
networks: | |
kong-net: | |
driver: bridge | |
services: | |
####################################### | |
# Postgres: The database used by Kong | |
####################################### | |
kong-database: | |
image: postgres:9.6 | |
restart: always | |
networks: | |
- kong-net | |
environment: | |
POSTGRES_USER: kong | |
POSTGRES_DB: kong | |
ports: | |
- "5432:5432" | |
restart: on-failure | |
healthcheck: | |
test: ["CMD", "pg_isready", "-U", "kong"] | |
interval: 10s | |
timeout: 5s | |
retries: 5 | |
####################################### | |
# Kong database migration | |
####################################### | |
kong-migration: | |
image: kong:ubuntu | |
networks: | |
- kong-net | |
environment: | |
KONG_PG_HOST: kong-database | |
restart: on-failure | |
depends_on: | |
- kong-database | |
volumes: | |
- D:\Developpement\archi\api-gateway\kong\wait-for-it.sh:/wait-for-it.sh | |
entrypoint: | |
- ./wait-for-it.sh | |
command: | |
- kong-database:5432 | |
- -- | |
- ./docker-entrypoint.sh | |
- kong | |
- migrations | |
- bootstrap | |
####################################### | |
# Kong: The API Gateway | |
####################################### | |
kong: | |
image: kong:ubuntu | |
restart: always | |
networks: | |
- kong-net | |
environment: | |
KONG_PG_HOST: kong-database | |
KONG_PROXY_LISTEN: 0.0.0.0:8000 | |
KONG_PROXY_LISTEN_SSL: 0.0.0.0:8443 | |
KONG_ADMIN_LISTEN: 0.0.0.0:8001 | |
depends_on: | |
- kong-migration | |
restart: on-failure | |
healthcheck: | |
test: ["CMD", "curl", "-f", "http://kong:8001"] | |
interval: 10s | |
timeout: 2s | |
retries: 15 | |
ports: | |
- "8001:8001" | |
- "8000:8000" | |
volumes: | |
- D:\Developpement\archi\api-gateway\kong\wait-for-it.sh:/wait-for-it.sh | |
entrypoint: | |
- ./wait-for-it.sh | |
command: | |
- kong-database:5432 | |
- --timeout=5 | |
- -- | |
- ./docker-entrypoint.sh | |
- kong | |
- docker-start | |
####################################### | |
# Konga database prepare | |
####################################### | |
konga-prepare: | |
image: pantsel/konga:next | |
networks: | |
- kong-net | |
restart: on-failure | |
depends_on: | |
- kong-database | |
volumes: | |
- D:\Developpement\archi\api-gateway\kong\wait-for-it.sh:/app/wait-for-it.sh | |
entrypoint: | |
- ./wait-for-it.sh | |
command: | |
- kong-database:5432 | |
- --timeout=5 | |
- -- | |
- /app/start.sh | |
- -c | |
- prepare | |
- -a | |
- postgres | |
- -u | |
- postgresql://kong@kong-database:5432/konga_db | |
####################################### | |
# Konga: Kong GUI | |
####################################### | |
konga: | |
image: pantsel/konga:next | |
restart: always | |
networks: | |
- kong-net | |
environment: | |
DB_ADAPTER: postgres | |
DB_HOST: kong-database | |
DB_USER: kong | |
TOKEN_SECRET: km1GUr4RkcQD7DewhJPNXrCuZwcKmqjb | |
DB_DATABASE: konga_db | |
NODE_ENV: development | |
depends_on: | |
- kong-database | |
ports: | |
- "1337:1337" | |
volumes: | |
- D:\Developpement\archi\api-gateway\kong\wait-for-it.sh:/app/wait-for-it.sh | |
entrypoint: | |
- ./wait-for-it.sh | |
command: | |
- kong:8001 | |
- --timeout=5 | |
- -- | |
- /app/start.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment