Add compose for stats service

pull/7293/head
Rim Rakhimov 2 years ago
parent 4610c7516f
commit aa78a4c851
  1. 27
      docker-compose/envs/common-stats.env
  2. 33
      docker-compose/services/docker-compose-stats.yml

@ -0,0 +1,27 @@
# Those are examples of existing configuration variables and their default values.
# When uncommented, they would overwrite corresponding values from `base.toml`
# configuration file.
STATS__SERVER__HTTP__ENABLED=true
STATS__SERVER__HTTP__ADDR=0.0.0.0:8050
STATS__SERVER__HTTP__MAX_BODY_SIZE=2097152
STATS__SERVER__GRPC__ENABLED=false
STATS__SERVER__GRPC__ADDR=0.0.0.0:8051
STATS__DB_URL=
STATS__BLOCKSCOUT_DB_URL=
STATS__RUN_MIGRATIONS=false
STATS__DEFAULT_SCHEDULE=0 0 1 * * * *
STATS__FORCE_UPDATE_ON_START=false
STATS__CHARTS_CONFIG=config/charts.toml
STATS__METRICS__ENABLED=false
STATS__METRICS__ADDR=0.0.0.0:6060
STATS__METRICS__ROUTE=/metrics
STATS__JAEGER__ENABLED=false
STATS__JAEGER__AGENT_ENDPOINT=localhost:6831
STATS__TRACING__ENABLED=true
STATS__TRACING__FORMAT=default

@ -0,0 +1,33 @@
version: '3.8'
services:
stats-db:
image: postgres:14
restart: always
container_name: 'stats-postgres'
command: postgres -c 'max_connections=200'
environment:
POSTGRES_PASSWORD: ''
POSTGRES_USER: 'postgres'
POSTGRES_HOST_AUTH_METHOD: 'trust'
ports:
- 7433:5432
stats:
platform: linux/x86_64
depends_on:
- stats-db
image: ghcr.io/blockscout/stats:${STATS_DOCKER_TAG:-main}
pull_policy: always
restart: always
container_name: 'stats'
extra_hosts:
- 'host.docker.internal:host-gateway'
env_file:
- ../envs/common-stats.env
environment:
- STATS__DB_URL=postgres://postgres:@stats-db:5432/stats
- STATS__BLOCKSCOUT_DB_URL=postgresql://postgres:@host.docker.internal:7432/blockscout?ssl=false
- STATS__RUN_MIGRATIONS=true
ports:
- 8153:8050
Loading…
Cancel
Save