Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
140 lines (131 loc) · 3.68 KB
/
Copy pathdocker-compose.yml
File metadata and controls
140 lines (131 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
version: '3.8'
services:
postgres:
image: postgres:16-alpine
container_name: remitmortgage-postgres
environment:
POSTGRES_USER: remituser
POSTGRES_PASSWORD: remitpass
POSTGRES_DB: remitmortgage
ports:
- "5432:5432"
volumes:
- postgres-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U remituser -d remitmortgage"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
restart: unless-stopped
redis-cluster-node-1:
image: redis:7-alpine
container_name: remitmortgage-redis-1
ports:
- "6379:6379"
command: redis-server --cluster-enabled yes --cluster-config-file nodes-1.conf --appendonly yes --port 6379
volumes:
- redis-node-1-data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
redis-cluster-node-2:
image: redis:7-alpine
container_name: remitmortgage-redis-2
ports:
- "6380:6379"
command: redis-server --cluster-enabled yes --cluster-config-file nodes-2.conf --appendonly yes --port 6379
volumes:
- redis-node-2-data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
redis-cluster-node-3:
image: redis:7-alpine
container_name: remitmortgage-redis-3
ports:
- "6381:6379"
command: redis-server --cluster-enabled yes --cluster-config-file nodes-3.conf --appendonly yes --port 6379
volumes:
- redis-node-3-data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
redis-cluster-init:
image: redis:7-alpine
container_name: remitmortgage-redis-init
depends_on:
redis-cluster-node-1:
condition: service_healthy
redis-cluster-node-2:
condition: service_healthy
redis-cluster-node-3:
condition: service_healthy
command: >
sh -c "
echo 'Creating Redis cluster...' &&
redis-cli --cluster create
redis-cluster-node-1:6379
redis-cluster-node-2:6379
redis-cluster-node-3:6379
--cluster-replicas 0
--cluster-yes
"
migration:
build:
context: ./backend
dockerfile: Dockerfile
container_name: remitmortgage-migration
environment:
DATABASE_URL: postgresql://remituser:remitpass@postgres:5432/remitmortgage
command: sh scripts/run-migrations.sh
depends_on:
postgres:
condition: service_healthy
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: remitmortgage-backend
environment:
DATABASE_URL: postgresql://remituser:remitpass@postgres:5432/remitmortgage
PORT: 4000
STELLAR_NETWORK: testnet
HORIZON_URL: http://stellar-quickstart:8000
REDIS_CLUSTER_ENABLED: "true"
REDIS_CLUSTER_NODES: redis-cluster-node-1:6379,redis-cluster-node-2:6379,redis-cluster-node-3:6379
ports:
- "4000:4000"
depends_on:
migration:
condition: service_completed_successfully
redis-cluster-init:
condition: service_completed_successfully
restart: unless-stopped
stellar-quickstart:
image: stellar/quickstart:latest
container_name: stellar-quickstart
ports:
- "8000:8000"
command: >
/start --local --enable-soroban-rpc
environment:
- NETWORK=local
volumes:
- stellar-data:/opt/stellar
restart: unless-stopped
volumes:
postgres-data:
redis-node-1-data:
redis-node-2-data:
redis-node-3-data:
stellar-data: