/ docker-compose.yml
docker-compose.yml
  1  services:
  2    rpc-proxy:
  3      build:
  4        context: './nginx-proxy'
  5      container_name: 'rpc-proxy'
  6      restart: 'always'
  7      environment:
  8        CONFIG_HEALTH_CHECKER_URL: 'http://health-checker:8082/providers'
  9        GO_AUTH_SERVICE_URL: 'http://auth-service:8081'
 10        CUSTOM_DNS: '127.0.0.11'
 11        RELOAD_INTERVAL: '10'
 12        AUTH_CONFIG_FILE: '/app/auth_config.json'
 13        GO_CACHE_SOCKET: '/tmp/cache.sock'
 14      ports:
 15        - '8080:8080'
 16      networks:
 17        - 'rpc-network'
 18      depends_on:
 19        - 'health-checker'
 20        - 'auth-service'
 21        - 'cache-service'
 22      volumes:
 23        - './secrets/default_providers.json:/app/providers.json:ro'
 24        - './secrets/.htpasswd:/etc/nginx/.htpasswd:ro'
 25        - './secrets/auth_config.json:/app/auth_config.json:ro'
 26        - 'cache_socket:/tmp'
 27      healthcheck:
 28        test: ['CMD-SHELL', 'nc -z 0.0.0.0 8080']
 29        interval: '30s'
 30        timeout: '30s'
 31        retries: 3
 32        start_period: '10s'
 33  
 34    auth-service:
 35      build:
 36        context: './proxy-common'
 37        dockerfile: auth/Dockerfile
 38      container_name: 'auth-service'
 39      restart: 'always'
 40      environment:
 41        CONFIG_FILE: '/app/config.json'
 42        PORT: '8081'
 43      networks:
 44        - 'rpc-network'
 45      volumes:
 46        - './secrets/auth_config.json:/app/config.json:ro'
 47      healthcheck:
 48        test: ['CMD-SHELL', 'wget -q -O - http://0.0.0.0:8081/auth/status || exit 1']
 49        interval: '30s'
 50        timeout: '30s'
 51        retries: 3
 52        start_period: '10s'
 53  
 54    health-checker:
 55      build:
 56        context: './rpc-health-checker'
 57      container_name: 'health-checker'
 58      restart: 'always'
 59      environment:
 60        DEFAULT_PROVIDERS_PATH: '/config/default_providers.json'
 61        REFERENCE_PROVIDERS_PATH: '/config/reference_providers.json'
 62        PORT: '8082'
 63      ports:
 64        - '8082:8082'
 65      networks:
 66        - 'rpc-network'
 67      volumes:
 68        - './secrets:/config:ro'
 69      healthcheck:
 70        test: ['CMD-SHELL', 'wget -q -O - http://0.0.0.0:8082/health']
 71        interval: '30s'
 72        timeout: '30s'
 73        retries: 3
 74        start_period: '10s'
 75  
 76    cache-service:
 77      build:
 78        context: '.'
 79        dockerfile: go-proxy-cache/Dockerfile
 80      container_name: 'cache-service'
 81      restart: 'always'
 82      environment:
 83        CACHE_CONFIG_FILE: '/app/cache_config.yaml'
 84        CACHE_RULES_FILE: '/app/cache_rules.yaml'
 85        CACHE_KEYDB_URL_FILE: '/app/.keydb-url'
 86        CACHE_SOCKET_PATH: '/tmp/cache.sock'
 87        CACHE_METRICS_PORT: '8099'
 88      ports:
 89        - '8099:8099'  # Expose metrics endpoint on port 8099
 90      networks:
 91        - 'rpc-network'
 92      volumes:
 93        - './go-proxy-cache/cache_config.yaml:/app/cache_config.yaml:ro'
 94        - './go-proxy-cache/cache_rules.yaml:/app/cache_rules.yaml:ro'
 95        - './secrets/.keydb-url:/app/.keydb-url:ro'
 96        - 'cache_socket:/tmp'
 97      healthcheck:
 98        test: ['CMD-SHELL', 'test -S /tmp/cache.sock || exit 1']
 99        interval: '30s'
100        timeout: '30s'
101        retries: 3
102        start_period: '10s'
103  
104  networks:
105    rpc-network:
106      driver: bridge
107  
108  volumes:
109    cache_socket: