Skip to content

Instantly share code, notes, and snippets.

@ruddra
Created November 24, 2023 15:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ruddra/11836bd726d29238ca49f5a19f8924b4 to your computer and use it in GitHub Desktop.
Save ruddra/11836bd726d29238ca49f5a19f8924b4 to your computer and use it in GitHub Desktop.
Kong gRPC
version: "3"
networks:
kong-net:
driver: bridge
services:
kong-database:
image: postgres:9.6
restart: always
networks:
- kong-net
environment:
POSTGRES_PASSWORD: kong
POSTGRES_USER: kong
POSTGRES_DB: kong
ports:
- "5432:5432"
healthcheck:
test: ["CMD", "pg_isready", "-U", "kong"]
interval: 5s
timeout: 5s
retries: 5
kong-migration:
image: kong:latest
command: "kong migrations bootstrap"
networks:
- kong-net
restart: on-failure
environment:
KONG_PG_HOST: kong-database
KONG_DATABASE: postgres
KONG_PG_PASSWORD: kong
links:
- kong-database
depends_on:
- kong-database
kong:
image: kong:latest
container_name: kong_01
restart: always
networks:
- kong-net
extra_hosts:
- "host.docker.internal:host-gateway"
environment:
KONG_DATABASE: postgres
KONG_PG_HOST: kong-database
KONG_PG_USER: kong
KONG_PG_PASSWORD: kong
KONG_PROXY_LISTEN: 0.0.0.0:8000 http2
KONG_PROXY_LISTEN_SSL: 0.0.0.0:8443 http2
KONG_ADMIN_LISTEN: 0.0.0.0:8001
KONG_DECLARATIVE_CONFIG: "/opt/kong/kong.yaml"
KONG_SSL_CERT: /ssl/server.crt
KONG_SSL_CERT_KEY: /ssl/server.key
depends_on:
- kong-migration
- kong-database
- consul
healthcheck:
test: ["CMD", "curl", "-f", "http://kong:8001"]
interval: 5s
timeout: 2s
retries: 15
ports:
- "8001:8001"
- "8000:8000"
volumes:
- ./config:/opt/kong
- ./application/ssl:/ssl
grpc-server:
build:
context: .
dockerfile: ./Dockerfile
container_name: grpc_server_01
depends_on:
- kong
volumes:
- ./application:/application
command: sh -c "python -u /application/server.py"
networks:
- kong-net
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment