-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.blockscout.yml
More file actions
154 lines (146 loc) · 4.66 KB
/
Copy pathdocker-compose.blockscout.yml
File metadata and controls
154 lines (146 loc) · 4.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# Standalone dev compose for running alongside Blockscout's shared infrastructure.
#
# Prerequisites: start-shared.sh must already be running in rayls-privacy-blockscout.
# cd ../rayls-privacy-blockscout && ./scripts/start-shared.sh
#
# Usage:
# docker compose -f docker-compose.blockscout.yml up --build
networks:
blockscout-shared:
external: true
name: blockscout-shared
services:
nats:
image: nats:2.10-alpine
command: ["-js", "-m", "8222"]
ports:
- "4222:4222"
- "8222:8222"
healthcheck:
test: ["CMD-SHELL", "wget -qO- http://localhost:8222/healthz || exit 1"]
interval: 5s
timeout: 5s
retries: 5
nui:
image: ghcr.io/nats-nui/nui:latest
command: ["--nats-cli-contexts", "/nats-contexts"]
ports:
- "31311:31311"
environment:
NATS_URL: "nats://nats:4222"
depends_on:
nats:
condition: service_healthy
# Idempotently creates ops_api and raylzdb in shared-db before other services start.
db-init:
image: postgres:17
networks:
- blockscout-shared
environment:
PGPASSWORD: dev-only-not-a-secret
entrypoint:
- sh
- -c
- >-
until pg_isready -h shared-db -U blockscout; do echo "waiting for shared-db..."; sleep 2; done &&
(createdb -h shared-db -U blockscout ops_api 2>/dev/null && echo "created ops_api" || echo "ops_api already exists") &&
(createdb -h shared-db -U blockscout raylzdb 2>/dev/null && echo "created raylzdb" || echo "raylzdb already exists")
restart: "no"
ops-api:
build:
context: .
dockerfile: Dockerfile.dev
ports:
- "8080:8080"
- "2345:2345" # Delve remote debugger
security_opt:
- seccomp:unconfined
cap_add:
- SYS_PTRACE
volumes:
- .:/app
- go_modules:/go/pkg/mod
env_file:
- ./config/.env
environment:
DATABASE_CONNECTIONSTRING: "host=host.docker.internal port=7432 user=blockscout password=dev-only-not-a-secret dbname=ops_api sslmode=disable"
BLOCKSCOUT_DB_CONN: "host=host.docker.internal port=7432 user=blockscout password=dev-only-not-a-secret dbname=blockscout_node-0 sslmode=disable"
CUSTODY_RAYLS_HSM_URL: "http://custody:5000"
NATS_URL: "nats://nats:4222"
depends_on:
db-init:
condition: service_completed_successfully
custody:
condition: service_healthy
nats:
condition: service_healthy
worker:
build:
context: .
dockerfile: Dockerfile.worker.dev
volumes:
- .:/app
- go_modules:/go/pkg/mod
env_file:
- ./config/.env
environment:
DATABASE_CONNECTIONSTRING: "host=host.docker.internal port=7432 user=blockscout password=dev-only-not-a-secret dbname=ops_api sslmode=disable"
BLOCKSCOUT_DB_CONN: "host=host.docker.internal port=7432 user=blockscout password=dev-only-not-a-secret dbname=blockscout_node-0 sslmode=disable"
NATS_URL: "nats://nats:4222"
depends_on:
db-init:
condition: service_completed_successfully
nats:
condition: service_healthy
custody:
build:
context: ../rayls-sovereign-custody-light
dockerfile: Dockerfile.dev
ports:
- "5032:5000"
volumes:
- ../rayls-sovereign-custody-light:/app
- nuget_cache:/root/.nuget/packages
- dotnet_obj_cache:/app/src/Rayls.Custody.HSM.API/obj
environment:
ASPNETCORE_ENVIRONMENT: LOC
MACHINE: DEBUG
POSTGRESQL_SERVER: host.docker.internal
POSTGRESQL_PORT: 7432
POSTGRESQL_USERNAME: blockscout
POSTGRESQL_PASSWORD: dev-only-not-a-secret
POSTGRESQL_DBNAME: raylzdb
AUTH_API_KEY: dev-only-custody-api-key
AUTH_JWT_SECRET: dev-only-not-a-secret-32byte-min
EVM_JSON_RPC_CHAIN_ID: 600001
EVM_JSON_RPC: http://host.docker.internal:8545
USES_AWS: "false"
KMS_MAX_WALLETS: 200
KEYSTORE_MAX_WALLETS: 20
DOTNET_USE_POLLING_FILE_WATCHER: "true"
entrypoint: ["/bin/bash", "-c"]
command:
- |
dotnet restore src/Rayls.Custody.HSM.API/Rayls.Custody.HSM.API.csproj
while true; do
dotnet run \
--project src/Rayls.Custody.HSM.API/Rayls.Custody.HSM.API.csproj \
--no-launch-profile \
--urls "http://+:5000"
echo "Custody app exited, restarting in 5s..."
sleep 5
done
depends_on:
db-init:
condition: service_completed_successfully
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "wget -qO- http://localhost:5000/api/health || exit 1"]
interval: 10s
timeout: 5s
retries: 15
start_period: 60s
volumes:
go_modules:
nuget_cache:
dotnet_obj_cache: