docker-compose.yml: separate network between api and kong

This commit is contained in:
2025-11-22 23:55:51 +07:00
parent 218bf15f71
commit 1af7defb90

View File

@@ -3,6 +3,10 @@ networks:
name: kong-api-gateway name: kong-api-gateway
driver: bridge driver: bridge
external: true external: true
accounting-api:
name: accounting-api
driver: bridge
external: true
services: services:
redis: redis:
@@ -12,7 +16,7 @@ services:
ports: ports:
- '6379:6379' - '6379:6379'
networks: networks:
- kong-api-gateway - accounting-api
kong-database: kong-database:
image: postgres:15 image: postgres:15
@@ -54,7 +58,7 @@ services:
KONG_PG_PASSWORD: kongpass KONG_PG_PASSWORD: kongpass
KONG_PG_DATABASE: kong KONG_PG_DATABASE: kong
KONG_ADMIN_LISTEN: 0.0.0.0:8001 KONG_ADMIN_LISTEN: 0.0.0.0:8001
KONG_PROXY_LISTEN: 0.0.0.0:8080, 0.0.0.0:8443 ssl KONG_PROXY_LISTEN: 0.0.0.0:8000, 0.0.0.0:8443 ssl
KONG_ADMIN_GUI_URL: http://10.9.0.0:8002 KONG_ADMIN_GUI_URL: http://10.9.0.0:8002
KONG_ADMIN_GUI_LISTEN: 0.0.0.0:8002 KONG_ADMIN_GUI_LISTEN: 0.0.0.0:8002
@@ -62,7 +66,7 @@ services:
KONG_ADMIN_ACCESS_LOG: /dev/stdout KONG_ADMIN_ACCESS_LOG: /dev/stdout
KONG_ADMIN_ERROR_LOG: /dev/stderr KONG_ADMIN_ERROR_LOG: /dev/stderr
ports: ports:
- "8080:8080" - "8000:8000"
- "8443:8443" - "8443:8443"
- "8001:8001" - "8001:8001"
- "8002:8002" - "8002:8002"
@@ -83,8 +87,9 @@ services:
PG_HOST: accounting-database PG_HOST: accounting-database
PG_PASS: ttc@2026 PG_PASS: ttc@2026
networks: networks:
- kong-api-gateway - accounting-api
ports: ports:
- "1011:1011"
- "1012:1012" - "1012:1012"
- "1013:1013" - "1013:1013"
@@ -96,10 +101,10 @@ services:
environment: environment:
POSTGRES_PASSWORD: ttc@2026 POSTGRES_PASSWORD: ttc@2026
POSTGRES_DB: ttc POSTGRES_DB: ttc
networks:
- accounting-api
ports: ports:
- "5432:5432" - "5432:5432"
volumes: volumes:
- './accounting-db:/var/lib/postgresql/data' - './accounting-db:/var/lib/postgresql/data'
networks:
- kong-api-gateway