Last active
August 13, 2020 20:31
-
-
Save siddhuoo7/fb924e0022d061ec6978d6845255086f to your computer and use it in GitHub Desktop.
docker-compose file for kong
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" | |
| volumes: | |
| kong_data: {} | |
| networks: | |
| kong-net: | |
| services: | |
| ####################################### | |
| # Postgres: The database used by Kong | |
| ####################################### | |
| kong-database: | |
| image: postgres:9.6 | |
| container_name: kong-postgres | |
| restart: on-failure | |
| networks: | |
| - kong-net | |
| volumes: | |
| - kong_data:/var/lib/postgresql/data | |
| environment: | |
| POSTGRES_USER: kong | |
| POSTGRES_PASSWORD: ${KONG_PG_PASSWORD:-kong} | |
| POSTGRES_DB: kong | |
| ports: | |
| - "5432:5432" | |
| healthcheck: | |
| test: ["CMD", "pg_isready", "-U", "kong"] | |
| interval: 30s | |
| timeout: 30s | |
| retries: 3 | |
| ####################################### | |
| # Kong database migration | |
| ####################################### | |
| kong-migration: | |
| image: ${KONG_DOCKER_TAG:-kong:latest} | |
| command: kong migrations bootstrap | |
| networks: | |
| - kong-net | |
| restart: on-failure | |
| environment: | |
| KONG_DATABASE: postgres | |
| KONG_PG_HOST: kong-database | |
| KONG_PG_DATABASE: kong | |
| KONG_PG_USER: kong | |
| KONG_PG_PASSWORD: ${KONG_PG_PASSWORD:-kong} | |
| depends_on: | |
| - kong-database | |
| ####################################### | |
| # Kong: The API Gateway | |
| ####################################### | |
| kong: | |
| image: ${KONG_DOCKER_TAG:-kong:latest} | |
| restart: on-failure | |
| container_name: kong | |
| networks: | |
| - kong-net | |
| environment: | |
| KONG_DATABASE: postgres | |
| KONG_PG_HOST: kong-database | |
| KONG_PG_DATABASE: kong | |
| KONG_PG_USER: kong | |
| KONG_PG_PASSWORD: ${KONG_PG_PASSWORD:-kong} | |
| KONG_PROXY_LISTEN: 0.0.0.0:8000 | |
| KONG_PROXY_LISTEN_SSL: 0.0.0.0:8443 | |
| KONG_ADMIN_LISTEN: 0.0.0.0:8001 | |
| depends_on: | |
| - kong-database | |
| healthcheck: | |
| test: ["CMD", "kong", "health"] | |
| interval: 10s | |
| timeout: 10s | |
| retries: 10 | |
| ports: | |
| - "8000:8000" | |
| - "8001:8001" | |
| - "8443:8443" | |
| - "8444:8444" | |
| ####################################### | |
| # Konga database prepare | |
| ####################################### | |
| konga-prepare: | |
| image: pantsel/konga:latest | |
| command: "-c prepare -a postgres -u postgresql://kong:${KONG_PG_PASSWORD:-kong}@kong-database:5432/konga" | |
| networks: | |
| - kong-net | |
| restart: on-failure | |
| depends_on: | |
| - kong-database | |
| ####################################### | |
| # Konga: Kong GUI | |
| ####################################### | |
| konga: | |
| image: pantsel/konga:latest | |
| container_name: konga | |
| restart: always | |
| networks: | |
| - kong-net | |
| environment: | |
| DB_ADAPTER: postgres | |
| DB_URI: postgresql://kong:${KONG_PG_PASSWORD:-kong}@kong-database:5432/konga | |
| NODE_ENV: production | |
| depends_on: | |
| - kong-database | |
| ports: | |
| - "1337:1337" |
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: '2.1' | |
| networks: | |
| monitor-net: | |
| driver: bridge | |
| volumes: | |
| prometheus_data: {} | |
| grafana_data: {} | |
| services: | |
| prometheus: | |
| image: prom/prometheus:v2.17.1 | |
| container_name: prometheus | |
| volumes: | |
| - ./prometheus:/etc/prometheus | |
| - prometheus_data:/prometheus | |
| command: | |
| - '--config.file=/etc/prometheus/prometheus.yml' | |
| - '--storage.tsdb.path=/prometheus' | |
| - '--web.console.libraries=/etc/prometheus/console_libraries' | |
| - '--web.console.templates=/etc/prometheus/consoles' | |
| - '--storage.tsdb.retention.time=200h' | |
| - '--web.enable-lifecycle' | |
| restart: unless-stopped | |
| expose: | |
| - 9090 | |
| networks: | |
| - monitor-net | |
| labels: | |
| org.label-schema.group: "monitoring" | |
| alertmanager: | |
| image: prom/alertmanager:v0.20.0 | |
| container_name: alertmanager | |
| volumes: | |
| - ./alertmanager:/etc/alertmanager | |
| command: | |
| - '--config.file=/etc/alertmanager/config.yml' | |
| - '--storage.path=/alertmanager' | |
| restart: unless-stopped | |
| expose: | |
| - 9093 | |
| networks: | |
| - monitor-net | |
| labels: | |
| org.label-schema.group: "monitoring" | |
| nodeexporter: | |
| image: prom/node-exporter:v0.18.1 | |
| container_name: nodeexporter | |
| volumes: | |
| - /proc:/host/proc:ro | |
| - /sys:/host/sys:ro | |
| - /:/rootfs:ro | |
| command: | |
| - '--path.procfs=/host/proc' | |
| - '--path.rootfs=/rootfs' | |
| - '--path.sysfs=/host/sys' | |
| - '--collector.filesystem.ignored-mount-points=^/(sys|proc|dev|host|etc)($$|/)' | |
| restart: unless-stopped | |
| expose: | |
| - 9100 | |
| networks: | |
| - monitor-net | |
| labels: | |
| org.label-schema.group: "monitoring" | |
| cadvisor: | |
| image: gcr.io/google-containers/cadvisor:v0.34.0 | |
| container_name: cadvisor | |
| volumes: | |
| - /:/rootfs:ro | |
| - /var/run:/var/run:rw | |
| - /sys:/sys:ro | |
| - /var/lib/docker:/var/lib/docker:ro | |
| #- /cgroup:/cgroup:ro #doesn't work on MacOS only for Linux | |
| restart: unless-stopped | |
| expose: | |
| - 8080 | |
| networks: | |
| - monitor-net | |
| labels: | |
| org.label-schema.group: "monitoring" | |
| grafana: | |
| image: grafana/grafana:6.7.2 | |
| container_name: grafana | |
| volumes: | |
| - grafana_data:/var/lib/grafana | |
| - ./grafana/provisioning:/etc/grafana/provisioning | |
| environment: | |
| - GF_SECURITY_ADMIN_USER=${ADMIN_USER} | |
| - GF_SECURITY_ADMIN_PASSWORD=${ADMIN_PASSWORD} | |
| - GF_USERS_ALLOW_SIGN_UP=false | |
| restart: unless-stopped | |
| expose: | |
| - 3000 | |
| networks: | |
| - monitor-net | |
| labels: | |
| org.label-schema.group: "monitoring" | |
| pushgateway: | |
| image: prom/pushgateway:v1.2.0 | |
| container_name: pushgateway | |
| restart: unless-stopped | |
| expose: | |
| - 9091 | |
| networks: | |
| - monitor-net | |
| labels: | |
| org.label-schema.group: "monitoring" | |
| caddy: | |
| image: stefanprodan/caddy | |
| container_name: caddy | |
| ports: | |
| - "3000:3000" | |
| - "9090:9090" | |
| - "9093:9093" | |
| - "9091:9091" | |
| volumes: | |
| - ./caddy:/etc/caddy | |
| environment: | |
| - ADMIN_USER=${ADMIN_USER} | |
| - ADMIN_PASSWORD=${ADMIN_PASSWORD} | |
| restart: unless-stopped | |
| networks: | |
| - monitor-net | |
| labels: | |
| org.label-schema.group: "monitoring" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment