Skip to content

Instantly share code, notes, and snippets.

@tota1099
Created November 3, 2022 19:50
Show Gist options
  • Save tota1099/61809d0c75b1f87f01a99ba039472a1b to your computer and use it in GitHub Desktop.
Save tota1099/61809d0c75b1f87f01a99ba039472a1b to your computer and use it in GitHub Desktop.
docker-compose.yml konga
version: "3.7"
volumes:
kong_data: {}
konga_data: {}
networks:
rdstation:
external: true
services:
kong-migrations:
platform: linux/x86_64
build: ./kong/
command: kong migrations bootstrap
volumes:
- "/home/RENAN.PORTO/git/kong-plugin-rate-limiting-quotas/kong/plugins/rate-limiting-quotas/:/usr/local/share/lua/5.1/kong/plugins/rate-limiting-quotas/:rw"
depends_on:
- db-kong
environment:
KONG_DATABASE: postgres
KONG_PG_DATABASE: ${KONG_PG_DATABASE:-kong}
KONG_PG_HOST: db-kong
KONG_PG_PORT: 5432
KONG_PG_USER: ${KONG_PG_USER:-kong}
KONG_PG_PASSWORD: ${KONG_PG_PW:-kong}
KONG_PLUGINS: "bundled,kong-plugin-url-rewrite,http-log-with-body,rate-limiting-quotas"
networks:
- rdstation
restart: on-failure
deploy:
restart_policy:
condition: on-failure
kong-migrations-up:
platform: linux/x86_64
build: ./kong/
volumes:
- "/home/RENAN.PORTO/git/kong-plugin-rate-limiting-quotas/kong/plugins/rate-limiting-quotas/:/usr/local/share/lua/5.1/kong/plugins/rate-limiting-quotas/:rw"
command: kong migrations up && kong migrations finish
depends_on:
- db-kong
environment:
KONG_DATABASE: postgres
KONG_PG_DATABASE: ${KONG_PG_DATABASE:-kong}
KONG_PG_HOST: db-kong
KONG_PG_PORT: 5432
KONG_PG_USER: ${KONG_PG_USER:-kong}
KONG_PG_PASSWORD: ${KONG_PG_PW:-kong}
KONG_PLUGINS: "bundled,kong-plugin-url-rewrite,http-log-with-body,rate-limiting-quotas"
networks:
- rdstation
restart: on-failure
deploy:
restart_policy:
condition: on-failure
kong:
platform: linux/x86_64
build: ./kong/
user: "${KONG_USER:-kong}"
volumes:
- "/home/RENAN.PORTO/git/kong-plugin-rate-limiting-quotas/kong/plugins/rate-limiting-quotas/:/usr/local/share/lua/5.1/kong/plugins/rate-limiting-quotas/:rw"
depends_on:
- db-kong
environment:
KONG_ADMIN_ACCESS_LOG: /dev/stdout
KONG_ADMIN_ERROR_LOG: /dev/stderr
KONG_ADMIN_LISTEN: "0.0.0.0:8001, 0.0.0.0:8444 ssl"
KONG_CASSANDRA_CONTACT_POINTS: db-kong
KONG_DATABASE: postgres
KONG_PG_DATABASE: ${KONG_PG_DATABASE:-kong}
KONG_PG_HOST: db-kong
KONG_PG_PORT: 5432
KONG_PG_USER: ${KONG_PG_USER:-kong}
KONG_PROXY_ACCESS_LOG: /dev/stdout
KONG_PROXY_ERROR_LOG: /dev/stderr
KONG_PG_PASSWORD: ${KONG_PG_PW:-kong}
KONG_PROXY_LISTEN: "0.0.0.0:8000, 0.0.0.0:8443 ssl, 0.0.0.0:9080 http2, 0.0.0.0:9081 http2 ssl"
KONG_PLUGINS: "bundled,kong-plugin-url-rewrite,http-log-with-body,rate-limiting-quotas"
KONG_LOG_LEVEL: debug
networks:
- rdstation
ports:
- "8000:8000/tcp"
- "8001:8001/tcp"
- "8443:8443/tcp"
- "8444:8444/tcp"
- "9080:9080/tcp"
- "9081:9081/tcp"
healthcheck:
test: ["CMD", "kong", "health"]
interval: 10s
timeout: 10s
retries: 10
restart: on-failure
deploy:
restart_policy:
condition: on-failure
db-kong:
platform: linux/x86_64
image: postgres:11.6-alpine
ports:
- "5431:5432/tcp"
environment:
POSTGRES_DB: ${KONG_PG_DATABASE:-kong}
POSTGRES_USER: ${KONG_PG_USER:-kong}
POSTGRES_PASSWORD: ${KONG_PG_PW:-kong}
healthcheck:
test: ["CMD", "pg_isready", "-U", "${KONG_PG_USER:-kong}"]
interval: 30s
timeout: 30s
retries: 3
restart: on-failure
deploy:
restart_policy:
condition: on-failure
stdin_open: true
tty: true
networks:
- rdstation
volumes:
- ./kong_data:/var/lib/postgresql/data
konga:
platform: linux/x86_64
image: pantsel/konga
ports:
- "1337:1337/tcp"
links:
- kong:kong
networks:
- rdstation
environment:
NO_AUTH: "true"
DB_ADAPTER: postgres
DB_PASSWORD: ${KONG_PG_PW:-kong}
DB_HOST: db-kong
DB_USER: ${KONG_PG_USER:-kong}
DB_DATABASE: ${KONG_PG_DATABASE:-kong}
redis-kong-rate-limiting-rdstation.local.rdops.systems:
image: redis:5.0.7-alpine
ports:
- 6379:6379
expose:
- 6379
networks:
- rdstation
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 10s
retries: 10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment