-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.ops.yml
More file actions
84 lines (81 loc) · 2.63 KB
/
Copy pathdocker-compose.ops.yml
File metadata and controls
84 lines (81 loc) · 2.63 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
# Snowball Ops Cron Services
# Runs oracle-updater, emission-cron, and mm-monitor on scheduled intervals.
# Usage: docker-compose -f docker-compose.ops.yml up -d
services:
oracle-updater:
image: node:18-alpine
working_dir: /app
volumes:
- .:/app
env_file: .env
entrypoint: ["/bin/sh", "-c"]
command:
- |
apk add --no-cache python3 make g++ && \
cd /app && \
NODE_PATH=apps/web/node_modules npm install --prefix apps/web --ignore-scripts 2>/dev/null || true && \
while true; do
echo "[oracle-updater] $(date -u +%Y-%m-%dT%H:%M:%SZ) — running..."
NODE_PATH=apps/web/node_modules npx tsx scripts/ops/oracle-updater.ts || \
echo "[oracle-updater] ERROR: script failed (exit $?)"
echo "[oracle-updater] sleeping 300s..."
sleep 300
done
restart: unless-stopped
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
emission-cron:
image: node:18-alpine
working_dir: /app
volumes:
- .:/app
env_file: .env
entrypoint: ["/bin/sh", "-c"]
command:
- |
apk add --no-cache python3 make g++ && \
cd /app && \
NODE_PATH=apps/web/node_modules npm install --prefix apps/web --ignore-scripts 2>/dev/null || true && \
while true; do
echo "[emission-cron] $(date -u +%Y-%m-%dT%H:%M:%SZ) — running..."
NODE_PATH=apps/web/node_modules npx tsx scripts/ops/emission-cron.ts || \
echo "[emission-cron] ERROR: script failed (exit $?)"
echo "[emission-cron] sleeping 86400s (24h)..."
sleep 86400
done
restart: unless-stopped
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
mm-monitor:
image: node:18-alpine
working_dir: /app
volumes:
- .:/app
env_file: .env
environment:
- API_BASE_URL=http://snowball-server:3001
entrypoint: ["/bin/sh", "-c"]
command:
- |
apk add --no-cache python3 make g++ && \
cd /app && \
NODE_PATH=apps/web/node_modules npm install --prefix apps/web --ignore-scripts 2>/dev/null || true && \
while true; do
echo "[mm-monitor] $(date -u +%Y-%m-%dT%H:%M:%SZ) — running..."
NODE_PATH=apps/web/node_modules npx tsx scripts/ops/mm-rebalance.ts || \
echo "[mm-monitor] ERROR: script failed (exit $?)"
echo "[mm-monitor] sleeping 86400s (24h)..."
sleep 86400
done
restart: unless-stopped
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"