Files
eth-rpc-proxy/docker-compose.yml

110 lines
2.9 KiB
YAML

services:
rpc-proxy:
build:
context: './nginx-proxy'
container_name: 'rpc-proxy'
restart: 'always'
environment:
CONFIG_HEALTH_CHECKER_URL: 'http://health-checker:8082/providers'
GO_AUTH_SERVICE_URL: 'http://auth-service:8081'
CUSTOM_DNS: '127.0.0.11'
RELOAD_INTERVAL: '10'
AUTH_CONFIG_FILE: '/app/auth_config.json'
GO_CACHE_SOCKET: '/tmp/cache.sock'
ports:
- '8080:8080'
networks:
- 'rpc-network'
depends_on:
- 'health-checker'
- 'auth-service'
- 'cache-service'
volumes:
- './secrets/default_providers.json:/app/providers.json:ro'
- './secrets/.htpasswd:/etc/nginx/.htpasswd:ro'
- './secrets/auth_config.json:/app/auth_config.json:ro'
- 'cache_socket:/tmp'
healthcheck:
test: ['CMD-SHELL', 'nc -z 0.0.0.0 8080']
interval: '30s'
timeout: '30s'
retries: 3
start_period: '10s'
auth-service:
build:
context: './proxy-common'
dockerfile: auth/Dockerfile
container_name: 'auth-service'
restart: 'always'
environment:
CONFIG_FILE: '/app/config.json'
PORT: '8081'
networks:
- 'rpc-network'
volumes:
- './secrets/auth_config.json:/app/config.json:ro'
healthcheck:
test: ['CMD-SHELL', 'wget -q -O - http://0.0.0.0:8081/auth/status || exit 1']
interval: '30s'
timeout: '30s'
retries: 3
start_period: '10s'
health-checker:
build:
context: './rpc-health-checker'
container_name: 'health-checker'
restart: 'always'
environment:
DEFAULT_PROVIDERS_PATH: '/config/default_providers.json'
REFERENCE_PROVIDERS_PATH: '/config/reference_providers.json'
PORT: '8082'
ports:
- '8082:8082'
networks:
- 'rpc-network'
volumes:
- './secrets:/config:ro'
healthcheck:
test: ['CMD-SHELL', 'wget -q -O - http://0.0.0.0:8082/health']
interval: '30s'
timeout: '30s'
retries: 3
start_period: '10s'
cache-service:
build:
context: '.'
dockerfile: go-proxy-cache/Dockerfile
container_name: 'cache-service'
restart: 'always'
environment:
CACHE_CONFIG_FILE: '/app/cache_config.yaml'
CACHE_RULES_FILE: '/app/cache_rules.yaml'
CACHE_KEYDB_URL_FILE: '/app/.keydb-url'
CACHE_SOCKET_PATH: '/tmp/cache.sock'
CACHE_METRICS_PORT: '8099'
ports:
- '8099:8099' # Expose metrics endpoint on port 8099
networks:
- 'rpc-network'
volumes:
- './go-proxy-cache/cache_config.yaml:/app/cache_config.yaml:ro'
- './go-proxy-cache/cache_rules.yaml:/app/cache_rules.yaml:ro'
- './secrets/.keydb-url:/app/.keydb-url:ro'
- 'cache_socket:/tmp'
healthcheck:
test: ['CMD-SHELL', 'test -S /tmp/cache.sock || exit 1']
interval: '30s'
timeout: '30s'
retries: 3
start_period: '10s'
networks:
rpc-network:
driver: bridge
volumes:
cache_socket: