Skip to content

Commit 759a20f

Browse files
authored
refactor: docker setup & example env files (#3360)
1 parent db2def5 commit 759a20f

File tree

76 files changed

+1458
-1676
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+1458
-1676
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
.husky
55
audits
66
docs
7+
docker-setup
78
scripts
89
**/node_modules
910
**/build

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,5 @@ hardhat-dependency-compiler
5151
cache
5252

5353
#docker databases
54-
docker-db
54+
docker-db
55+
graph-node-db

docker-setup/.env.compose

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MINIO_PORT=9000
2+
3+
# NOTE: Avoid changing this since it impact KV store urls
4+
BACKEND_APPS_INTERNAL_PORT=5000
5+
6+
REPUTATION_ORACLE_EXPOSED_PORT=5001
7+
HUMAN_APP_SERVER_EXPOSED_PORT=5002
8+
JOB_LAUNCHER_EXPOSED_PORT=5003
9+
EXCHANGE_ORACLE_CVAT_EXPOSED_PORT=5004
10+
RECORDING_ORACLE_CVAT_EXPOSED_PORT=5005
11+
EXCHANGE_ORACLE_FORTUNE_EXPOSED_PORT=5006
12+
RECORDING_ORACLE_FORTUNE_EXPOSED_PORT=5007
13+
14+
HUMAN_APP_CLIENT_EXPOSED_PORT=3001
15+
JOB_LAUNCHER_CLIENT_EXPOSED_PORT=3002
16+
FORTUNE_CLIENT_EXPOSED_PORT=3003
17+
18+
RPC_URL_POLYGON_AMOY=https://rpc-amoy.polygon.technology
19+
20+
# Might be empty
21+
SUBGRAPH_API_KEY=

docker-setup/Makefile

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
.PHONY: check-env-file \
2+
infra-up infra-stop \
3+
build-services services-up services-stop
4+
5+
DOCKER_PARALLEL ?= 4
6+
7+
check-env-file:
8+
@if [ ! -f "./.env.compose.local" ]; then \
9+
cp ./.env.compose ./.env.compose.local ; \
10+
fi
11+
12+
infra-up:
13+
docker-compose --env-file .env.compose.local up -d postgres redis minio minio-client
14+
15+
infra-stop:
16+
docker-compose --env-file .env.compose.local stop postgres redis minio minio-client
17+
18+
build-services:
19+
docker-compose --env-file .env.compose.local --parallel $(DOCKER_PARALLEL) up --no-start
20+
21+
services-up:
22+
@service_names="$(wordlist 2, $(words $(MAKECMDGOALS)), $(MAKECMDGOALS))"; \
23+
docker-compose --env-file .env.compose.local --parallel $(DOCKER_PARALLEL) up -d $$service_names
24+
25+
services-stop:
26+
@service_names="$(wordlist 2, $(words $(MAKECMDGOALS)), $(MAKECMDGOALS))"; \
27+
docker-compose --env-file .env.compose.local stop $$service_names
28+
29+
# catch-all and noop; to avoid warnings when using MAKECMDGOALS
30+
%:
31+
@:

0 commit comments

Comments
 (0)