Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set up monitoring infrastructure #144

Merged
merged 11 commits into from
Oct 8, 2022
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ Following urls are accessible after the project is successfully started.
| [http://localhost:8082/](http://localhost:8082/) | Redis management interface. |
| [http://localhost:8083/](http://localhost:8083/) | RabbitMq management interface. |
| [http://localhost:8084/](http://localhost:8084/) | Traefik management interface. |
| [http://localhost:8085/](http://localhost:8085/) | Grafana management interface. |

### Production

Expand Down
25 changes: 25 additions & 0 deletions docker-compose.production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,30 @@ services:
- "traefik.enable=true"
- "traefik.http.routers.nchan.priority=20"
- "traefik.http.routers.nchan.rule=PathPrefix(`/sse`)"
grafana:
image: marein/php-gaming-website:grafana
restart: on-failure
environment:
GF_AUTH_DISABLE_LOGIN_FORM: 1
GF_AUTH_ANONYMOUS_ENABLED: 1
GF_AUTH_ANONYMOUS_ORG_ROLE: Admin
ports:
- "8085:3000"
prometheus:
image: marein/php-gaming-website:prometheus
restart: on-failure
user: root # Needed for accessing docker.sock. In prod, it may be handled via file permissions.
command:
- '--config.file=/etc/prometheus/prometheus-docker.yml'
- '--storage.tsdb.path=/prometheus'
volumes:
- prometheus:/prometheus
- /var/run/docker.sock:/var/run/docker.sock
node-exporter:
image: quay.io/prometheus/node-exporter
labels:
- "prometheus-job=node"
- "prometheus-port=9100"
service-js-polyfill:
image: gamingplatform/service-js-polyfill
restart: on-failure
Expand Down Expand Up @@ -100,3 +124,4 @@ volumes:
mysql:
redis:
rabbit-mq:
prometheus:
31 changes: 31 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,36 @@ services:
- php-fpm
volumes:
- /var/run/docker.sock:/var/run/docker.sock
grafana:
build:
context: .
dockerfile: ./docker/grafana/Dockerfile
environment:
GF_AUTH_DISABLE_LOGIN_FORM: 1
GF_AUTH_ANONYMOUS_ENABLED: 1
GF_AUTH_ANONYMOUS_ORG_ROLE: Admin
ports:
- "8085:3000"
volumes:
- ./docker/grafana/provisioning:/etc/grafana/provisioning
- ./docker/grafana/dashboards:/var/lib/grafana/dashboards
prometheus:
build:
context: .
dockerfile: ./docker/prometheus/Dockerfile
user: root # Needed for accessing docker.sock. In prod, it may be handled via file permissions.
command:
- '--config.file=/etc/prometheus/prometheus-docker.yml'
- '--storage.tsdb.path=/prometheus'
volumes:
- prometheus:/prometheus
- /var/run/docker.sock:/var/run/docker.sock
restart: on-failure
node-exporter:
image: quay.io/prometheus/node-exporter
labels:
- "prometheus-job=node"
- "prometheus-port=9100"
mysql:
build:
context: .
Expand Down Expand Up @@ -167,3 +197,4 @@ volumes:
mysql:
redis:
rabbit-mq:
prometheus:
4 changes: 4 additions & 0 deletions docker/grafana/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM grafana/grafana-oss:8.5.2

COPY /docker/grafana/provisioning /etc/grafana/provisioning
COPY /docker/grafana/dashboards /var/lib/grafana/dashboards
Loading