-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.cluster.yml
More file actions
71 lines (65 loc) · 1.71 KB
/
Copy pathdocker-compose.cluster.yml
File metadata and controls
71 lines (65 loc) · 1.71 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
version: '3.8'
services:
postgres:
image: postgres:15-alpine
container_name: crdt_postgres_cluster
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
POSTGRES_DB: crdt_engine
volumes:
- pgdata_cluster:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
redis:
image: redis:7-alpine
container_name: crdt_redis_cluster
command: redis-server --appendonly yes
volumes:
- redisdata_cluster:/data
backend-1:
build:
context: ./backend
dockerfile: Dockerfile
container_name: sync_backend_1
environment:
DATABASE_URL: "postgresql://postgres:password@postgres:5432/crdt_engine?schema=public"
REDIS_URL: "redis://redis:6379"
PORT: "8080"
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_started
# No ports exposed directly to host; NGINX will proxy to it
backend-2:
build:
context: ./backend
dockerfile: Dockerfile
container_name: sync_backend_2
environment:
DATABASE_URL: "postgresql://postgres:password@postgres:5432/crdt_engine?schema=public"
REDIS_URL: "redis://redis:6379"
PORT: "8080"
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_started
# No ports exposed directly to host; NGINX will proxy to it
nginx:
image: nginx:alpine
container_name: sync_nginx
ports:
- "8080:8080"
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
- backend-1
- backend-2
volumes:
pgdata_cluster:
redisdata_cluster: