diff --git a/docker-compose/envs/common-stats.env b/docker-compose/envs/common-stats.env new file mode 100644 index 0000000000..b52b9ee863 --- /dev/null +++ b/docker-compose/envs/common-stats.env @@ -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 diff --git a/docker-compose/services/docker-compose-stats.yml b/docker-compose/services/docker-compose-stats.yml new file mode 100644 index 0000000000..f5c7d8ee62 --- /dev/null +++ b/docker-compose/services/docker-compose-stats.yml @@ -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