-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdocker-compose.yml
43 lines (42 loc) · 1.33 KB
/
docker-compose.yml
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
version: "3.4" # optional since v1.27.0
volumes:
chain:
services:
postgres:
image: postgres
environment:
POSTGRES_DB: "${DB_NAME}"
POSTGRES_USER: "${DB_USER}"
POSTGRES_PASSWORD: "${DB_PASSWORD}"
ports:
- "127.0.0.1:5432:5432"
substrate:
image: sora2/substrate:1.0.0
ports:
- "127.0.0.1:9933:9933"
- "127.0.0.1:9944:9944"
volumes:
- chain:/chain
command: --name sora2-node --chain main --base-path /chain --unsafe-ws-external --unsafe-rpc-external --pruning archive --rpc-cors all
healthcheck:
test: >-
curl -H 'Content-Type: application/json' -d '{"id": 1, "jsonrpc": "2.0", "method": "system_health", "params": []}' 127.0.0.1:9933 | grep -E 'result'
interval: 10s
timeout: 5s
retries: 3
start_period: 300s
import:
build: .
depends_on:
postgres:
condition: service_started
substrate:
condition: service_healthy
command: "env SUBSTRATE_URL=ws://substrate:9944 DATABASE_URL=postgresql+asyncpg://${DB_USER}:${DB_PASSWORD}@postgres/${DB_NAME} sh start.sh"
web:
build: .
depends_on:
- "postgres"
ports:
- "80:8000"
command: "env DATABASE_URL=postgresql+asyncpg://${DB_USER}:${DB_PASSWORD}@postgres/${DB_NAME} gunicorn -w 4 -k uvicorn.workers.UvicornWorker -b 0.0.0.0 web:app"