Browse Source

Simplify ports configuration

Leszek Wiesner 3 years ago
parent
commit
663d4a1e7f
2 changed files with 14 additions and 13 deletions
  1. 9 9
      .env
  2. 5 4
      docker-compose.yml

+ 9 - 9
.env

@@ -19,14 +19,14 @@ TYPEORM_LOGGING=error
 # Note, that if there are already some indexed events, this setting is ignored
 BLOCK_HEIGHT=0
 
-# 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
+# Query node GraphQL server port
+GRAPHQL_SERVER_PORT=8081
+
+# Hydra indexer gateway GraphQL server port
+HYDRA_INDEXER_GATEWAY_PORT=4000
+
+# Default GraphQL server host. It is required by the query-node start script.
 GRAPHQL_SERVER_HOST=localhost
-WARTHOG_APP_PORT=${GRAPHQL_SERVER_PORT}
-WARTHOG_APP_HOST=localhost
 
 # Websocket RPC endpoint containers will use.
 JOYSTREAM_NODE_WS=ws://joystream-node:9944/
@@ -39,7 +39,7 @@ COLOSSUS_QUERY_NODE_HOST=graphql-server:${GRAPHQL_SERVER_PORT}
 DISTRIBUTOR_QUERY_NODE_URL=http://graphql-server:${GRAPHQL_SERVER_PORT}/graphql
 
 # Indexer gateway used by processor. If you don't use the local indexer set this to a remote gateway
-PROCESSOR_INDEXER_GATEWAY=http://hydra-indexer-gateway:${GRAPHQL_SERVER_PORT}/graphql
+PROCESSOR_INDEXER_GATEWAY=http://hydra-indexer-gateway:${HYDRA_INDEXER_GATEWAY_PORT}/graphql
 
 # Colossus services identities
 COLOSSUS_1_WORKER_ID=0
@@ -54,4 +54,4 @@ DISTRIBUTOR_2_WORKER_ID=1
 DISTRIBUTOR_2_ACCOUNT_URI=//testing//worker//Distribution//${DISTRIBUTOR_2_WORKER_ID}
 
 # joystream/node docker image tag
-JOYSTREAM_NODE_TAG=latest
+JOYSTREAM_NODE_TAG=latest

+ 5 - 4
docker-compose.yml

@@ -169,8 +169,9 @@ services:
       - .env
     environment:
       - DB_HOST=db
+      - WARTHOG_APP_PORT=${GRAPHQL_SERVER_PORT}
     ports:
-      - '127.0.0.1:8081:${WARTHOG_APP_PORT}'
+      - '127.0.0.1:${GRAPHQL_SERVER_PORT}:${GRAPHQL_SERVER_PORT}'
     depends_on:
       - db
     volumes:
@@ -236,11 +237,11 @@ services:
       - WARTHOG_STARTER_DB_PORT=${DB_PORT}
       - WARTHOG_STARTER_DB_USERNAME=${DB_USER}
       - WARTHOG_STARTER_REDIS_URI=redis://redis:6379/0
-      - WARTHOG_APP_PORT=${WARTHOG_APP_PORT}
-      - PORT=${WARTHOG_APP_PORT}
+      - WARTHOG_APP_PORT=${HYDRA_INDEXER_GATEWAY_PORT}
+      - PORT=${HYDRA_INDEXER_GATEWAY_PORT}
       - DEBUG=*
     ports:
-      - '127.0.0.1:4000:${WARTHOG_APP_PORT}'
+      - '127.0.0.1:${HYDRA_INDEXER_GATEWAY_PORT}:${HYDRA_INDEXER_GATEWAY_PORT}'
     depends_on:
       - db
       - redis