diff options
-rw-r--r-- | docker-compose.yml | 73 |
1 files changed, 71 insertions, 2 deletions
diff --git a/docker-compose.yml b/docker-compose.yml index ed0c55b..77c5f8a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,7 +7,76 @@ services: - db-data:/var/lib/postgresql/data ports: - "5432:5432" + labels: + - "traefik.backend=postgresql" + - "traefik.frontend.rule=Host:postgresql.docker.localhost" + - "traefik.port=5432" + - "traefik.enable=true" + + ################################################################################ + # Reverse Proxy / Load Balancer + ################################################################################ + traefik: + image: traefik + command: --api --docker + ports: + - "80:80" + - "8080:8080" + volumes: + - /var/run/docker.sock:/var/run/docker.sock + labels: + - "traefik.backend=traefik" + - "traefik.frontend.rule=Host:traefik.docker.localhost" + - "traefik.port=8080" + - "traefik.enable=true" + + ################################################################################ + # Monitoring + ################################################################################ + prometheus: + image: prom/prometheus + ports: + - "9090:9090" + labels: + - "traefik.backend=prometheus" + - "traefik.frontend.rule=Host:prometheus.docker.localhost" + - "traefik.port=9090" + - "traefik.enable=true" + networks: + - public + volumes: + - "./prometheus.yml:/etc/prometheus/prometheus.yml" + command: + - '--config.file=/etc/prometheus/prometheus.yml' + + postgresql-exporter: + image: wrouesnel/postgres_exporter:v0.4.1 + networks: + - public + environment: + - DATA_SOURCE_NAME=postgresql://localhost:5432/?sslmode=disable + ports: + - "9187:9187" + labels: + - "traefik.backend=postgresql-exporter" + - "traefik.frontend.rule=Host:postgresql-exporter.docker.localhost" + - "traefik.port=9187" + - "traefik.enable=true" + + grafana: + image: grafana/grafana + labels: + - "traefik.backend=grafana" + - "traefik.frontend.rule=Host:grafana.docker.localhost" + - "traefik.port=3000" + - "traefik.enable=true" + volumes: + - "grafana_data:/var/lib/grafana" + volumes: - db-data: - driver: local + grafana_data: {} + db-data: {} + +networks: + public: |