Browse Source

docker-compose refactor to match behaviour of _APP_PORT env vars

Mokhtar Naamani 3 years ago
parent
commit
cf7b8b433b
2 changed files with 14 additions and 16 deletions
  1. 8 11
      .env
  2. 6 5
      docker-compose.yml

+ 8 - 11
.env

@@ -14,23 +14,20 @@ DB_PORT=5432
 DEBUG=index-builder:*
 TYPEORM_LOGGING=error
 
-###########################
-#    Indexer options      #
-###########################
-
+## Indexer options
 # Block height to start indexing from.
 # Note, that if there are already some indexed events, this setting is ignored
 BLOCK_HEIGHT=0
 
-###############################
-#    Processor GraphQL API    #
-###############################
+# Websocket RPC endpoint hydra indexer will use.
+INDEXER_WS_PROVIDER_ENDPOINT_URI=ws://joystream-node:9944/
 
+# GraphQL ports (WARTHOG_APP_HOST overrides GRAPHQL_SERVER_PORT)
+# So keep them the safe to avoid confusion, as long as each service is
+# run in a separate container on same host then there is no issue.
+# It does not make sense to have both but hydra codegen demands them.
 GRAPHQL_SERVER_PORT=4001
 GRAPHQL_SERVER_HOST=graphql-server
 
-WARTHOG_APP_PORT=4002
+WARTHOG_APP_PORT=4001
 WARTHOG_APP_HOST=hydra-indexer-gateway
-
-# Websocket RPC endpoint hydra indexer will use
-WS_PROVIDER_ENDPOINT_URI=ws://joystream-node:9944/

+ 6 - 5
docker-compose.yml

@@ -40,7 +40,7 @@ services:
     command: [
       'yarn', 'storage-node', 'server', '--worker=0', '--port=3333', '--uploads=/data',
       '--sync', '--syncInterval=1',
-      '--queryNodeHost=graphql-server:${GRAPHQL_SERVER_PORT}',
+      '--queryNodeHost=graphql-server:${WARTHOG_APP_PORT}',
       '--apiUrl=ws://joystream-node:9944/'
     ]
 
@@ -62,7 +62,7 @@ services:
     # Node configuration can be overriden via env, for exampe:
     environment:
       # JOYSTREAM_DISTRIBUTOR__ID: node-id
-      JOYSTREAM_DISTRIBUTOR__ENDPOINTS__QUERY_NODE: http://${GRAPHQL_SERVER_HOST}:${GRAPHQL_SERVER_PORT}/graphql
+      JOYSTREAM_DISTRIBUTOR__ENDPOINTS__QUERY_NODE: http://graphql-server:${WARTHOG_APP_PORT}/graphql
       JOYSTREAM_DISTRIBUTOR__KEYS: "[{\"suri\":\"//testing//workers//Distribution//0\"}]"
       JOYSTREAM_DISTRIBUTOR__WORKER_ID: 0
       JOYSTREAM_DISTRIBUTOR__PORT: 3334
@@ -100,7 +100,7 @@ services:
     command: [
       'yarn', 'storage-node', 'server', '--worker=1', '--port=3333', '--uploads=/data',
       '--sync', '--syncInterval=1',
-      '--queryNodeHost=graphql-server:${GRAPHQL_SERVER_PORT}',
+      '--queryNodeHost=graphql-server:${WARTHOG_APP_PORT}',
       '--apiUrl=ws://joystream-node:9944/'
     ]
 
@@ -122,7 +122,7 @@ services:
     # Node configuration can be overriden via env, for exampe:
     environment:
       # JOYSTREAM_DISTRIBUTOR__ID: node-id
-      JOYSTREAM_DISTRIBUTOR__ENDPOINTS__QUERY_NODE: http://${GRAPHQL_SERVER_HOST}:${GRAPHQL_SERVER_PORT}/graphql
+      JOYSTREAM_DISTRIBUTOR__ENDPOINTS__QUERY_NODE: http://graphql-server:${WARTHOG_APP_PORT}/graphql
       JOYSTREAM_DISTRIBUTOR__KEYS: "[{\"suri\":\"//testing//workers//Distribution//1\"}]"
       JOYSTREAM_DISTRIBUTOR__WORKER_ID: 1
       JOYSTREAM_DISTRIBUTOR__PORT: 3334
@@ -162,7 +162,7 @@ services:
       # relative to working directory where docker-compose was run from
       - .env
     ports:
-      - '127.0.0.1:8081:${GRAPHQL_SERVER_PORT}'
+      - '127.0.0.1:8081:${WARTHOG_APP_PORT}'
     depends_on:
       - db
     volumes:
@@ -204,6 +204,7 @@ services:
       - INDEXER_WORKERS=5
       - REDIS_URI=redis://redis:6379/0
       - TYPES_JSON=types.json
+      - WS_PROVIDER_ENDPOINT_URI=${INDEXER_WS_PROVIDER_ENDPOINT_URI}
     depends_on:
       - db
       - redis