Created
May 7, 2020 17:36
-
-
Save valmirphp/9a8459430aa11490a28f12d599c5a31a to your computer and use it in GitHub Desktop.
Doker: Kong + Konka
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.7" | |
networks: | |
kong-net: | |
name: kong-net | |
driver: bridge | |
ipam: | |
config: | |
- subnet: 172.1.1.0/24 | |
services: | |
kong-database: | |
container_name: kong-database | |
image: postgres:11-alpine | |
restart: always | |
networks: | |
- kong-net | |
environment: | |
POSTGRES_USER: kong | |
POSTGRES_DB: kong | |
POSTGRES_PASSWORD: kong | |
POSTGRES_HOST_AUTH_METHOD: trust | |
ports: | |
- "5432:5432" | |
healthcheck: | |
test: ["CMD", "pg_isready", "-U", "kong"] | |
interval: 30s | |
timeout: 3s | |
retries: 5 | |
kong-migration: | |
container_name: kong-migration | |
image: kong:2.0.3-alpine | |
command: "kong migrations bootstrap" | |
networks: | |
- kong-net | |
restart: on-failure | |
environment: | |
KONG_PG_HOST: kong-database | |
links: | |
- kong-database | |
depends_on: | |
- kong-database | |
kong: | |
container_name: kong | |
image: kong:2.0.3-alpine | |
restart: always | |
networks: | |
kong-net: | |
ipv4_address: 172.1.1.40 | |
# volumes: | |
# - ./kong/kong.conf:/etc/kong/kong.conf | |
environment: | |
KONG_PG_HOST: kong-database | |
KONG_ADMIN_LISTEN: '0.0.0.0:8001, 0.0.0.0:8444 ssl' | |
KONG_DB_UPDATE_FREQUENCY: 1m | |
depends_on: | |
- kong-migration | |
- kong-database | |
healthcheck: | |
test: ["CMD", "curl", "-f", "http://kong:8001"] | |
interval: 30s | |
timeout: 3s | |
retries: 10 | |
ports: | |
- "8001:8001" | |
- "8444:8444" | |
- "8000:8000" | |
- "8443:8443" | |
konga-prepare: | |
container_name: konga-prepare | |
image: pantsel/konga:0.14.1 | |
command: "-c prepare -a postgres -u postgresql://kong:kong@kong-database:5432/konga_db" | |
networks: | |
- kong-net | |
restart: on-failure | |
links: | |
- kong-database | |
depends_on: | |
- kong-database | |
konga: | |
container_name: konga | |
image: pantsel/konga:0.14.1 | |
restart: always | |
networks: | |
- kong-net | |
environment: | |
DB_ADAPTER: postgres | |
DB_HOST: kong-database | |
DB_USER: kong | |
TOKEN_SECRET: UIXYn91vwFcfxMNL3EHxVee79qx9eRtD | |
DB_DATABASE: konga_db | |
NODE_ENV: production | |
depends_on: | |
- kong-database | |
ports: | |
- "1337:1337" | |
servicea: | |
build: ./service-a | |
container_name: servicea | |
networks: | |
- kong-net | |
dns: 172.1.1.42 | |
serviceb: | |
image: wesleywillians/servicea | |
command: "./entrypoint.sh" | |
networks: | |
- kong-net | |
dns: 172.1.1.43 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment