-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
148 lines (121 loc) · 3.68 KB
/
Copy pathdocker-compose.yml
File metadata and controls
148 lines (121 loc) · 3.68 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
# ZecKit - Main Docker Compose Configuration
# Milestone 2: Zebra + Faucet + Lightwalletd
services:
zebra:
# Using official Zebra image from Zcash Foundation
image: zfnd/zebra:1.9.0
container_name: zecdev-zebra
networks:
- zecdev
# Port mappings (localhost only for security)
ports:
- "127.0.0.1:8232:8232" # RPC
- "127.0.0.1:8233:8233" # P2P
# Mount configuration and persistent state
volumes:
- zebra-data:/var/zebra/state
- ./docker/configs/zebra.toml:/etc/zebrad/zebrad.toml:ro
# Environment variables
environment:
- NETWORK=Regtest
- RUST_LOG=info,zebrad=debug
- RUST_BACKTRACE=1
# Health check to ensure Zebra is ready
healthcheck:
test: |
curl -sf --max-time 5 \
--data-binary '{"jsonrpc":"2.0","id":"healthcheck","method":"getinfo","params":[]}' \
-H 'content-type: application/json' \
http://localhost:8232/ > /dev/null || exit 1
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
# Restart policy
restart: unless-stopped
# Resource limits
deploy:
resources:
limits:
memory: 4G
reservations:
memory: 2G
faucet:
build:
context: ./faucet
dockerfile: Dockerfile
container_name: zecdev-faucet
networks:
- zecdev
# Port mappings
ports:
- "127.0.0.1:8080:8080" # Faucet API
# Environment variables
environment:
- ZEBRA_RPC_URL=http://zebra:8232
- FLASK_ENV=development
- LOG_LEVEL=DEBUG
- FAUCET_AMOUNT_DEFAULT=10.0
- FAUCET_AMOUNT_MIN=1.0
- FAUCET_AMOUNT_MAX=100.0
- RATE_LIMIT_ENABLED=true
- RATE_LIMIT_REQUESTS=10
- RATE_LIMIT_WINDOW=3600
# Volume for wallet persistence
volumes:
- faucet-data:/var/faucet
# Wait for Zebra to be healthy
depends_on:
zebra:
condition: service_healthy
# Health check
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
interval: 15s
timeout: 5s
retries: 3
start_period: 20s
# Restart policy
restart: unless-stopped
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# Lightwalletd Backend (start with: docker compose --profile lwd up -d)
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
lightwalletd:
image: electriccoinco/lightwalletd:v0.4.18
container_name: zecdev-lightwalletd
networks:
- zecdev
# Port mappings
ports:
- "127.0.0.1:9067:9067" # gRPC
# Command with proper flags pointing to Zebra
command:
- "--grpc-bind-addr=0.0.0.0:9067"
- "--zcash-conf-path=/etc/lightwalletd/zcash.conf"
- "--no-tls-very-insecure"
- "--log-level=4"
- "--data-dir=/var/lib/lightwalletd"
# Volume for lightwalletd data and config
volumes:
- lightwalletd-data:/var/lib/lightwalletd
- ./docker/configs/zcash.conf:/etc/lightwalletd/zcash.conf:ro
# Wait for Zebra
depends_on:
zebra:
condition: service_healthy
# Restart policy
restart: unless-stopped
# Only start when explicitly requested
profiles:
- lwd
networks:
zecdev:
driver: bridge
name: zecdev-network
volumes:
zebra-data:
name: zecdev-zebra-data
faucet-data:
name: zecdev-faucet-data
lightwalletd-data:
name: zecdev-lightwalletd-data