From 218bf15f71bfe1ff132ea64274c21ef0dec6a9b2 Mon Sep 17 00:00:00 2001 From: supphakitd <67319010028@technictrang.ac.th> Date: Fri, 21 Nov 2025 17:05:03 +0700 Subject: [PATCH] docker-compose.yml: initial Signed-off-by: supphakitd <67319010028@technictrang.ac.th> --- docker-compose.yml | 105 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 docker-compose.yml diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..aa8141d --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,105 @@ +networks: + kong-api-gateway: + name: kong-api-gateway + driver: bridge + external: true + +services: + redis: + image: redis:latest + restart: always + container_name: redis + ports: + - '6379:6379' + networks: + - kong-api-gateway + + kong-database: + image: postgres:15 + container_name: kong-database + environment: + POSTGRES_USER: kong + POSTGRES_DB: kong + POSTGRES_PASSWORD: kongpass + ports: + - "55432:5432" + volumes: + - './data-kong:/var/lib/postgresql/data' + networks: + - kong-api-gateway + + kong-migrations: + image: kong:3.5 + container_name: kong-migrations + depends_on: + - kong-database + environment: + KONG_DATABASE: postgres + KONG_PG_HOST: kong-database + KONG_PG_USER: kong + KONG_PG_PASSWORD: kongpass + KONG_PG_DATABASE: kong + networks: + - kong-api-gateway + + kong: + image: kong:3.5 + container_name: kong-api-gateway + depends_on: + - kong-database + environment: + KONG_DATABASE: postgres + KONG_PG_HOST: kong-database + KONG_PG_USER: kong + KONG_PG_PASSWORD: kongpass + KONG_PG_DATABASE: kong + KONG_ADMIN_LISTEN: 0.0.0.0:8001 + KONG_PROXY_LISTEN: 0.0.0.0:8080, 0.0.0.0:8443 ssl + + KONG_ADMIN_GUI_URL: http://10.9.0.0:8002 + KONG_ADMIN_GUI_LISTEN: 0.0.0.0:8002 + + KONG_ADMIN_ACCESS_LOG: /dev/stdout + KONG_ADMIN_ERROR_LOG: /dev/stderr + ports: + - "8080:8080" + - "8443:8443" + - "8001:8001" + - "8002:8002" + extra_hosts: + - "host.docker.internal:host-gateway" + networks: + - kong-api-gateway + + accounting-api: + image: accounting-api:latest + container_name: accounting-api + restart: always + depends_on: + - redis + environment: + REDIS_HOST: redis + REDIS_PORT: 6379 + PG_HOST: accounting-database + PG_PASS: ttc@2026 + networks: + - kong-api-gateway + ports: + - "1012:1012" + - "1013:1013" + + accounting-database: + image: postgres:16 + container_name: accounting-database + restart: always + shm_size: 128mb + environment: + POSTGRES_PASSWORD: ttc@2026 + POSTGRES_DB: ttc + ports: + - "5432:5432" + volumes: + - './accounting-db:/var/lib/postgresql/data' + networks: + - kong-api-gateway +