Skip to content

Commit

Permalink
rebased, minor improvements for docker compose
Browse files Browse the repository at this point in the history
  • Loading branch information
0xBigBoss committed May 5, 2023
1 parent f873e52 commit 8549297
Show file tree
Hide file tree
Showing 8 changed files with 971 additions and 27 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/var
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ build_and_watch: ## Continous build Pocket's main entrypoint as files change
# TODO(olshansky): Need to think of a Pocket related name for `compose_and_watch`, maybe just `pocket_watch`?
.PHONY: compose_and_watch
compose_and_watch: docker_check db_start monitoring_start ## Run a localnet composed of 4 consensus validators w/ hot reload & debugging
${docker-compose} up --force-recreate node1.consensus node2.consensus node3.consensus node4.consensus
${docker-compose} up --force-recreate node1.consensus node2.consensus node3.consensus node4.consensus node5.servicer

.PHONY: rebuild_and_compose_and_watch
rebuild_and_compose_and_watch: docker_check db_start monitoring_start ## Rebuilds the container from scratch and launches compose_and_watch
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"health_check_period": "30s"
},
"p2p": {
"hostname": "node1.servicer",
"hostname": "node5.servicer",
"port": 42069,
"use_rain_tree": true,
"is_empty_connection_type": false,
Expand Down
28 changes: 16 additions & 12 deletions build/deployments/.env.example
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
# docker compose stuff
# override with your own values if the default host port mappings in docker-compose do not suit you
# NODE1_PORT_7081=127.0.0.1:7081
# NODE1_DEBUG_PORT=127.0.0.1:7081
# NODE1_PORT_9081=127.0.0.1:9081
# NODE1_PORT_42070=127.0.0.1:42070
# NODE1_PORT_50832=127.0.0.1:50832
# NODE2_PORT_7081=127.0.0.1:7082
# NODE1_P2P_PORT=127.0.0.1:42070
# NODE1_RPC_PORT=127.0.0.1:50832
# NODE2_DEBUG_PORT=127.0.0.1:7082
# NODE2_PORT_9081=127.0.0.1:9082
# NODE2_PORT_42070=127.0.0.1:42071
# NODE2_PORT_50832=127.0.0.1:50833
# NODE3_PORT_7081=127.0.0.1:7083
# NODE2_P2P_PORT=127.0.0.1:42071
# NODE2_RPC_PORT=127.0.0.1:50833
# NODE3_DEBUG_PORT=127.0.0.1:7083
# NODE3_PORT_9081=127.0.0.1:9083
# NODE3_PORT_42070=127.0.0.1:42072
# NODE3_PORT_50832=127.0.0.1:50834
# NODE4_PORT_7081=127.0.0.1:7084
# NODE3_P2P_PORT=127.0.0.1:42072
# NODE3_RPC_PORT=127.0.0.1:50834
# NODE4_DEBUG_PORT=127.0.0.1:7084
# NODE4_PORT_9081=127.0.0.1:9084
# NODE4_PORT_42070=127.0.0.1:42073
# NODE4_PORT_50832=127.0.0.1:50835
# NODE4_P2P_PORT=127.0.0.1:42073
# NODE4_RPC_PORT=127.0.0.1:50835
# NODE5_DEBUG_PORT:-0.0.0.0:7085
# NODE5_PORT_9081:-0.0.0.0:9085
# NODE5_P2P_PORT:-0.0.0.0:42074
# NODE5_RPC_PORT:-0.0.0.0:50836
# GRAFANA_PORT_3000=127.0.0.1:3000
# POSTGRES_PORT_5432=127.0.0.1:5432
# LOKI_PORT_3100=127.0.0.1:3100
Expand Down
54 changes: 42 additions & 12 deletions build/deployments/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ services:
- "42069"
- "50832"
ports:
- "${NODE1_PORT_7081:-0.0.0.0:7081}:7081"
- "${NODE1_DEBUG_PORT:-0.0.0.0:7081}:7081"
- "${NODE1_PORT_9081:-0.0.0.0:9081}:9080"
- "${NODE1_PORT_42070:-0.0.0.0:42070}:42069"
- "${NODE1_PORT_50832:-0.0.0.0:50832}:50832"
- "${NODE1_P2P_PORT:-0.0.0.0:42070}:42069"
- "${NODE1_RPC_PORT:-0.0.0.0:50832}:50832"
volumes:
- ${PWD}:/go/src/github.com/pocket-network
# Needed for DLV debugging
Expand Down Expand Up @@ -74,10 +74,10 @@ services:
- "9000"
- "50832"
ports:
- "${NODE2_PORT_7081:-0.0.0.0:7082}:7081"
- "${NODE2_DEBUG_PORT:-0.0.0.0:7082}:7081"
- "${NODE2_PORT_9081:-0.0.0.0:9082}:9080"
- "${NODE2_PORT_42070:-0.0.0.0:42071}:42069"
- "${NODE2_PORT_50832:-0.0.0.0:50833}:50832"
- "${NODE2_P2P_PORT:-0.0.0.0:42071}:42069"
- "${NODE2_RPC_PORT:-0.0.0.0:50833}:50832"
volumes:
- ${PWD}:/go/src/github.com/pocket-network
# Needed for DLV debugging
Expand All @@ -102,10 +102,10 @@ services:
- "9000"
- "50832"
ports:
- "${NODE3_PORT_7081:-0.0.0.0:7083}:7081"
- "${NODE3_DEBUG_PORT:-0.0.0.0:7083}:7081"
- "${NODE3_PORT_9081:-0.0.0.0:9083}:9080"
- "${NODE3_PORT_42070:-0.0.0.0:42072}:42069"
- "${NODE3_PORT_50832:-0.0.0.0:50834}:50832"
- "${NODE3_P2P_PORT:-0.0.0.0:42072}:42069"
- "${NODE3_RPC_PORT:-0.0.0.0:50834}:50832"
volumes:
- ${PWD}:/go/src/github.com/pocket-network
# Needed for DLV debugging
Expand All @@ -130,10 +130,10 @@ services:
- "9000"
- "50832"
ports:
- "${NODE4_PORT_7081:-0.0.0.0:7084}:7081"
- "${NODE4_DEBUG_PORT:-0.0.0.0:7084}:7081"
- "${NODE4_PORT_9081:-0.0.0.0:9084}:9080"
- "${NODE4_PORT_42070:-0.0.0.0:42073}:42069"
- "${NODE4_PORT_50832:-0.0.0.0:50835}:50832"
- "${NODE4_P2P_PORT:-0.0.0.0:42073}:42069"
- "${NODE4_RPC_PORT:-0.0.0.0:50835}:50832"
volumes:
- ${PWD}:/go/src/github.com/pocket-network
# Needed for DLV debugging
Expand All @@ -143,6 +143,36 @@ services:
# environment:
# - DEBUG_PORT=7084

node5.servicer:
logging: *loki-logging
container_name: node5.servicer
image: pocket/servicer:latest
command: "build/scripts/watch.sh build/config/config.servicer.json build/config/genesis.json"
build:
context: ../..
dockerfile: ./build/Dockerfile.localdev
expose:
- "7085" # dlv debug
- "42069"
- "9080"
- "9000"
- "50832"
ports:
- "${NODE5_DEBUG_PORT:-0.0.0.0:7085}:7085"
- "${NODE5_PORT_9081:-0.0.0.0:9085}:9080"
- "${NODE5_P2P_PORT:-0.0.0.0:42074}:42069"
- "${NODE5_RPC_PORT:-0.0.0.0:50836}:50832"
volumes:
- ${PWD}:/go/src/github.com/pocket-network
# Needed for DLV debugging
security_opt:
- "seccomp:unconfined"
# Uncomment to enable DLV debugging
environment:
- POCKET_RPC_USE_CORS=true
- LIBP2P_DEBUG=info
- DEBUG_PORT=7085

db:
logging: *loki-logging
container_name: pocket-db
Expand Down
Loading

0 comments on commit 8549297

Please sign in to comment.