forked from Mystery-CLI/StellarEscrow
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
145 lines (137 loc) · 3.58 KB
/
docker-compose.yml
File metadata and controls
145 lines (137 loc) · 3.58 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
version: '3.8'
services:
postgres:
image: postgres:15-alpine
environment:
POSTGRES_DB: stellar_escrow
POSTGRES_USER: indexer
POSTGRES_PASSWORD: password
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U indexer -d stellar_escrow"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
indexer:
build:
context: .
dockerfile: indexer/Dockerfile
ports:
- "3000:3000"
environment:
DATABASE_URL: postgres://indexer:password@postgres:5432/stellar_escrow
RUST_LOG: info
CDN_PURGE_URL: ${CDN_PURGE_URL:-}
CDN_PURGE_TOKEN: ${CDN_PURGE_TOKEN:-}
depends_on:
postgres:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/health"]
interval: 30s
timeout: 5s
retries: 3
start_period: 15s
restart: unless-stopped
api:
build:
context: api
dockerfile: Dockerfile
ports:
- "4000:4000"
environment:
DATABASE_URL: postgres://indexer:password@postgres:5432/stellar_escrow
INDEXER_URL: http://indexer:3000
NODE_ENV: production
depends_on:
postgres:
condition: service_healthy
indexer:
condition: service_healthy
healthcheck:
test: ["CMD", "wget", "-qO-", "http://localhost:4000/health"]
interval: 30s
timeout: 5s
retries: 3
start_period: 15s
restart: unless-stopped
client:
build:
context: client
dockerfile: Dockerfile
ports:
- "3001:3001"
environment:
PUBLIC_API_URL: http://api:4000
PUBLIC_INDEXER_URL: http://indexer:3000
depends_on:
api:
condition: service_healthy
healthcheck:
test: ["CMD", "wget", "-qO-", "http://localhost:3001/"]
interval: 30s
timeout: 5s
retries: 3
start_period: 15s
restart: unless-stopped
nginx:
image: nginx:alpine
ports:
- "80:80"
- "443:443"
volumes:
- ./ssl.nginx.conf:/etc/nginx/conf.d/ssl.conf:ro
- ./cdn-headers.nginx.conf:/etc/nginx/conf.d/cdn-headers.conf:ro
- certbot_webroot:/var/www/certbot:ro
- letsencrypt:/etc/letsencrypt:ro
depends_on:
indexer:
condition: service_healthy
client:
condition: service_healthy
healthcheck:
test: ["CMD", "nginx", "-t"]
interval: 30s
timeout: 5s
retries: 3
restart: unless-stopped
certbot:
image: certbot/certbot:latest
volumes:
- certbot_webroot:/var/www/certbot
- letsencrypt:/etc/letsencrypt
entrypoint: >
sh -c "trap exit TERM;
while :; do
certbot renew --webroot -w /var/www/certbot --quiet;
sleep 12h & wait $${!};
done"
backup:
image: postgres:15-alpine
environment:
DATABASE_URL: ${DATABASE_URL:-postgres://indexer:password@postgres:5432/stellar_escrow}
S3_BUCKET: ${S3_BUCKET:-}
BACKUP_DIR: /var/backups/stellarescrow
RETENTION_DAYS: ${RETENTION_DAYS:-30}
BACKUP_ALERT_WEBHOOK: ${BACKUP_ALERT_WEBHOOK:-}
volumes:
- backup_data:/var/backups/stellarescrow
- ./scripts/backup.sh:/scripts/backup.sh:ro
depends_on:
postgres:
condition: service_healthy
entrypoint: >
sh -c "trap exit TERM;
while :; do
sleep 86400 & wait $${!};
bash /scripts/backup.sh;
done"
volumes:
postgres_data:
certbot_webroot:
letsencrypt:
backup_data: