diff --git a/conf/grafana/provisioning/datasources/prometheus.yaml b/conf/grafana/provisioning/datasources/prometheus.yaml index 289aaf1..843b97b 100644 --- a/conf/grafana/provisioning/datasources/prometheus.yaml +++ b/conf/grafana/provisioning/datasources/prometheus.yaml @@ -1,11 +1,11 @@ # config file version apiVersion: 1 datasources: - name: Prometheus type: prometheus - url: http://localhost:5080/prometheus + url: http://localhost:5081/prometheus access: direct isDefault: true version: 1 editable: false diff --git a/conf/nginx.conf b/conf/nginx.conf index e40515a..8e79087 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,55 +1,55 @@ worker_processes 4; # Show startup logs on stderr; switch to debug to print, well, debug logs when # running nginx-debug error_log /dev/stderr info; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; # Built-in Docker resolver. Needed to allow on-demand resolution of proxy # upstreams. # resolver 127.0.0.11 valid=30s; upstream appserver { # fail_timeout=0 means we always retry an upstream even if it failed # to return a good HTTP response server "web:5004" fail_timeout=0; } upstream prometheus { server "prometheus:9090" fail_timeout=0; } upstream grafana { server "grafana:3000" fail_timeout=0; } server { - listen 80 default_server; + listen 5081 default_server; location /prometheus { set $upstream "http://prometheus"; proxy_pass $upstream; } location /grafana { set $upstream "http://grafana"; rewrite ^/grafana/(.*)$ /$1 break; proxy_pass $upstream; } location / { set $upstream "http://appserver"; proxy_pass $upstream; } } } diff --git a/docker-compose.yml b/docker-compose.yml index 2230330..b12a551 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,132 +1,132 @@ version: "3.7" services: memcache: image: memcached deploy: replicas: 1 db-storage: image: postgres:11 deploy: replicas: 1 placement: constraints: - node.role == manager command: ['-c', 'shared_buffers=2GB', '-c', 'effective_cache_size=2GB', '-c', 'random_page_cost=1.5'] environment: POSTGRES_PASSWORD_FILE: /run/secrets/postgres-password POSTGRES_USER: swh volumes: - "storage:/var/lib/postgresql/data" secrets: - source: postgres-password uid: '999' mode: 0400 web: image: softwareheritage/web:latest configs: - source: web target: /etc/softwareheritage/config.yml command: - serve environment: PORT: "5004" depends_on: - memcache objstorage: image: softwareheritage/base:latest deploy: replicas: 1 placement: constraints: - node.role == manager volumes: - "objstorage:/srv/softwareheritage/objects" configs: - source: objstorage target: /etc/softwareheritage/config.yml environment: PORT: "5003" STATSD_HOST: prometheus-statsd-exporter STATSD_PORT: 9125 command: - objstorage storage: image: softwareheritage/base:latest configs: - source: storage target: /etc/softwareheritage/config.yml environment: PGHOST: db-storage PORT: "5002" STATSD_HOST: prometheus-statsd-exporter STATSD_PORT: 9125 command: - storage depends_on: - db-storage secrets: - source: postgres-password mode: 0400 nginx: image: nginx configs: - source: nginx target: /etc/nginx/nginx.conf ports: - - "5080:80" + - "5081:5081/tcp" deploy: placement: constraints: - node.role == manager prometheus: image: prom/prometheus depends_on: - prometheus-statsd-exporter command: # Needed for the reverse-proxy - "--web.external-url=/prometheus" - "--config.file=/etc/prometheus/prometheus.yml" volumes: - "./conf/prometheus.yml:/etc/prometheus/prometheus.yml:ro" prometheus-statsd-exporter: image: prom/statsd-exporter command: - "--statsd.mapping-config=/etc/prometheus/statsd-mapping.yml" volumes: - "./conf/prometheus-statsd-mapping.yml:/etc/prometheus/statsd-mapping.yml:ro" grafana: image: grafana/grafana depends_on: - prometheus environment: - GF_SERVER_ROOT_URL: http://localhost:5080/grafana + GF_SERVER_ROOT_URL: http://localhost:5081/grafana volumes: - "./conf/grafana/provisioning:/etc/grafana/provisioning:ro" - "./conf/grafana/dashboards:/var/lib/grafana/dashboards" volumes: objstorage: storage: secrets: postgres-password: external: true configs: web: file: conf/web.yml storage: file: conf/storage.yml objstorage: file: conf/objstorage.yml nginx: file: conf/nginx.conf