forked from StellarEdu/StellarEduPay
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
78 lines (73 loc) · 2.09 KB
/
Copy pathdocker-compose.yml
File metadata and controls
78 lines (73 loc) · 2.09 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
version: '3.8'
services:
backend:
build: ./backend
ports:
- "${PORT:-5000}:5000"
environment:
- MONGO_URI=mongodb://mongo:27017/stellaredupay
- STELLAR_NETWORK=${STELLAR_NETWORK}
- SCHOOL_WALLET_ADDRESS=${SCHOOL_WALLET_ADDRESS}
- STELLAR_SECRET_KEY=${STELLAR_SECRET_KEY}
depends_on:
mongo:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:5000/health || exit 0"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
frontend:
build:
context: ./frontend
args:
# NEXT_PUBLIC_* vars are inlined at build time by Next.js — pass as build arg
NEXT_PUBLIC_API_URL: ${NEXT_PUBLIC_API_URL:-http://localhost:5000/api}
NEXT_PUBLIC_STELLAR_NETWORK: ${STELLAR_NETWORK:-testnet}
ports:
- "3000:3000"
depends_on:
backend:
condition: service_healthy
mongo:
image: mongo:7
ports:
- "27017:27017"
volumes:
- mongo_data:/data/db
healthcheck:
test: ["CMD", "mongosh", "--eval", "db.runCommand({ ping: 1 })"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
# Runs a mongodump every 24 hours and retains 7 days of backups.
# Backups are written to the host path defined by BACKUP_DIR (default: ./backups).
backup:
image: mongo:7
entrypoint: >
/bin/sh -c '
while true; do
echo "[backup] $(date -u) — starting backup";
mongodump
--uri="$$MONGO_URI"
--archive="/backups/$$(date -u +%Y%m%dT%H%M%SZ).gz"
--gzip &&
echo "[backup] done" ||
echo "[backup] FAILED";
find /backups -name "*.gz" -mtime +$$RETAIN_DAYS -delete;
sleep 86400;
done
'
environment:
- MONGO_URI=mongodb://mongo:27017/stellaredupay
- RETAIN_DAYS=${RETAIN_DAYS:-7}
volumes:
- ${BACKUP_DIR:-./backups}:/backups
depends_on:
mongo:
condition: service_healthy
restart: unless-stopped
volumes:
mongo_data: