-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
184 lines (177 loc) · 4.46 KB
/
docker-compose.yaml
File metadata and controls
184 lines (177 loc) · 4.46 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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
version: '3.8'
services:
ui:
image: ghcr.io/marctheshark3/sigmanaut-mining-pool-ui:${TAG:-latest}
build:
context: .
dockerfile: Dockerfile
volumes:
- ./conf:/app/conf:ro
- flask_session:/app/flask_session
ports:
- "8050:8050"
environment:
- SECRET_KEY=${SECRET_KEY}
- ALLOWED_ORIGINS=${ALLOWED_ORIGINS:-*}
- FLASK_ENV=production
- REDIS_URL=redis://redis:6379/0
- PYTHONUNBUFFERED=1 # Enable real-time logging
- BASE_URL=${BASE_URL:-http://localhost}
depends_on:
redis:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8050/health || exit 1"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
deploy:
resources:
limits:
cpus: '1.0'
memory: 1G
reservations:
cpus: '0.25'
memory: 512M
restart: unless-stopped
networks:
- app_network
redis:
image: redis:alpine
command: redis-server --appendonly yes --maxmemory 512mb --maxmemory-policy allkeys-lru
volumes:
- redis_data:/data
ports:
- "6380:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 5
start_period: 10s
deploy:
resources:
limits:
cpus: '0.50'
memory: 512M
reservations:
cpus: '0.20'
memory: 256M
restart: unless-stopped
networks:
- app_network
payment-updater:
build:
context: .
dockerfile: Dockerfile.payment-updater
environment:
- POSTGRES_DB=${POSTGRES_DB:-miningcore}
- POSTGRES_USER=${POSTGRES_USER:-postgres}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-password}
- POSTGRES_HOST=${POSTGRES_HOST:-localhost}
- POSTGRES_PORT=${POSTGRES_PORT:-5432}
- PYTHONUNBUFFERED=1
deploy:
resources:
limits:
cpus: '0.50'
memory: 512M
reservations:
cpus: '0.20'
memory: 256M
restart: unless-stopped
networks:
- app_network
miner-id-minter:
image: ghcr.io/marctheshark3/sigmanaut-mining-pool-minter:${TAG:-latest}
build:
context: ./off-chain
dockerfile: Dockerfile
args:
- PUBLIC_URL=/miner-id-minter
ports:
- "3000:3000"
environment:
- NODE_ENV=production
- PUBLIC_URL=/miner-id-minter
- REACT_APP_PUBLIC_URL=/miner-id-minter
- REACT_APP_BASE_URL=${BASE_URL:-http://localhost}
- REACT_APP_THEME=dark
- FLASK_ENV=production
- ALLOWED_ORIGINS=*
- ALLOW_IFRAME=true
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/health || exit 1"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
deploy:
resources:
limits:
cpus: '1.0'
memory: 1G
reservations:
cpus: '0.25'
memory: 512M
restart: unless-stopped
depends_on:
- ui
networks:
- app_network
nginx:
image: nginx:stable-alpine
ports:
- "80:80"
volumes:
- ./nginx/nginx.conf.template:/etc/nginx/nginx.conf.template:ro
- ./nginx/default.conf:/etc/nginx/conf.d/default.conf:ro
- ./conf/nginx.rate.conf:/etc/nginx/conf.d/rate_limit.conf:ro
- nginx_cache:/var/cache/nginx
environment:
- DOMAIN_NAME=${DOMAIN_NAME:-localhost}
command: >
/bin/sh -c "envsubst '$$DOMAIN_NAME' < /etc/nginx/nginx.conf.template > /etc/nginx/nginx.conf
&& nginx -g 'daemon off;'"
healthcheck:
test: ["CMD", "nginx", "-t"]
interval: 30s
timeout: 10s
retries: 3
deploy:
resources:
limits:
cpus: '0.30'
memory: 256M
reservations:
cpus: '0.10'
memory: 128M
depends_on:
- ui
- miner-id-minter
restart: unless-stopped
networks:
- app_network
certbot:
image: certbot/certbot:latest
volumes:
- certbot_www:/var/www/certbot/:rw
- certbot_conf:/etc/letsencrypt/:rw
environment:
- DOMAIN_NAME=${DOMAIN_NAME:-localhost}
- EMAIL_FOR_SSL=${EMAIL_FOR_SSL}
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"
depends_on:
- nginx
networks:
- app_network
networks:
app_network:
driver: bridge
volumes:
redis_data:
nginx_cache:
flask_session:
certbot_www:
certbot_conf: