Skip to content

Instantly share code, notes, and snippets.

@cchacin
Created October 31, 2020 03:28
Show Gist options
  • Save cchacin/ac898bd9345d864fe82ebc675535b687 to your computer and use it in GitHub Desktop.
Save cchacin/ac898bd9345d864fe82ebc675535b687 to your computer and use it in GitHub Desktop.
Observability Containers - Docker Compose - Kibana - Graphana - ElasticSearch - Prometheus
version: "3.7"
services:
portainer:
image: portainer/portainer:1.24.1-alpine
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /tmp/portainer_password:/tmp/portainer_password
ports:
- 9000:9000
command: -H unix:///var/run/docker.sock --no-auth
filebeat:
image: docker.elastic.co/beats/filebeat-oss:7.9.3
environment:
- SERVICE_NAME=example-app
- ENVIRONMENT=staging
- ELASTICSEARCH_HOST=elasticsearch:9200
- KIBANA_HOST=kibana:5601
volumes:
- ./filebeat/filebeat.yml:/usr/share/filebeat/filebeat.yml
- /var/run/docker.sock:/var/run/docker.sock
- /var/lib/docker/containers/:/var/lib/docker/containers/:ro
user: root
depends_on:
- kibana
- elasticsearch
links:
- kibana
- elasticsearch
restart: always
networks:
- myservice-network
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch-oss:7.9.3
environment:
- discovery.type=single-node
ports:
- 9200:9200
- 9300:9300
restart: always
networks:
- myservice-network
kibana:
image: docker.elastic.co/kibana/kibana-oss:7.9.3
ports:
- 5601:5601
environment:
- ELASTICSEARCH_HOSTS=http://elasticsearch:9200
depends_on:
- elasticsearch
links:
- elasticsearch
restart: always
networks:
- myservice-network
jaeger:
image: jaegertracing/all-in-one:1.20.0
ports:
- 5775:5775
- 6831:6831
- 6832:6832
- 5778:5778
- 16686:16686
- 14268:14268
depends_on:
- elasticsearch
links:
- elasticsearch
networks:
- myservice-network
prometheus:
image: prom/prometheus:v2.22.0
volumes:
- ./prometheus/:/etc/prometheus/
command:
- '--config.file=/etc/prometheus/prometheus.yml'
ports:
- 9090:9090
restart: always
depends_on:
- myservice
links:
- myservice
networks:
- myservice-network
grafana:
image: grafana/grafana:7.3.0
user: "104"
ports:
- 3000:3000
restart: always
environment:
- GF_AUTH_ANONYMOUS_ENABLED=true
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
volumes:
- ./grafana/datasources.yml:/etc/grafana/provisioning/datasources/datasource.yml
- ./grafana/mp-dashboard.json:/var/lib/grafana/dashboards/mp-dashboard.json
- ./grafana/mp-fault-tolerance.json:/var/lib/grafana/dashboards/mp-fault-tolerance.json
- ./grafana/dashboards.yml:/etc/grafana/provisioning/dashboards/all.yml
links:
- prometheus
- myservice
networks:
- myservice-network
postgres:
image: postgres:13-alpine
ports:
- 5432:5432
environment:
- POSTGRES_PASSWORD=postgres
restart: always
networks:
- myservice-network
pgadmin:
image: dpage/pgadmin4:4.27
environment:
PGADMIN_DEFAULT_EMAIL: [email protected]
PGADMIN_DEFAULT_PASSWORD: admin
volumes:
- ./postgres/servers.json:/pgadmin4/servers.json
ports:
- 5050:80
restart: always
links:
- postgres
networks:
- myservice-network
myservice:
image: ccchacin/myservice:1.0-SNAPSHOT
depends_on:
- filebeat
- jaeger
- postgres
ports:
- 8080:8080
restart: always
links:
- jaeger
- postgres
networks:
- myservice-network
networks:
myservice-network:
name: myservice-network
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment