-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
145 lines (139 loc) · 3.69 KB
/
docker-compose.yml
File metadata and controls
145 lines (139 loc) · 3.69 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
services:
postgres:
image: postgres:16-alpine
container_name: ${SERVICE_NAME:-messenger}-postgres
restart: unless-stopped
environment:
POSTGRES_USER: ${POSTGRES_USER:-synapse}
POSTGRES_DB: ${POSTGRES_DB:-synapse}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
PGDATA: /var/lib/postgresql/data/pgdata
volumes:
- postgres_data:/var/lib/postgresql/data
deploy:
resources:
limits:
cpus: '0.2'
memory: 128M
reservations:
cpus: '0.1'
memory: 32M
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-synapse}"]
interval: 10s
timeout: 5s
retries: 5
networks:
- ${NETWORK_NAME:-nginx-network}
redis:
image: redis:7-alpine
container_name: ${SERVICE_NAME:-messenger}-redis
restart: unless-stopped
command: redis-server --requirepass ${REDIS_PASSWORD} --maxmemory 64mb --maxmemory-policy allkeys-lru --port ${REDIS_PORT:-6379}
volumes:
- redis_data:/data
deploy:
resources:
limits:
cpus: '0.25'
memory: 64M
reservations:
cpus: '0.05'
memory: 16M
healthcheck:
test: ["CMD", "redis-cli", "--raw", "incr", "ping"]
interval: 10s
timeout: 3s
retries: 5
networks:
- ${NETWORK_NAME:-nginx-network}
synapse:
image: matrixdotorg/synapse:latest
container_name: ${SERVICE_NAME:-messenger}-synapse
restart: unless-stopped
user: "${CURRENT_UID:-1000}:${CURRENT_GID:-1000}"
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
volumes:
- ./synapse/data:/data
env_file:
- .env
environment:
SYNAPSE_SERVER_NAME: ${DOMAIN}
SYNAPSE_REPORT_STATS: "no"
deploy:
resources:
limits:
cpus: '0.2'
memory: 128M
reservations:
cpus: '0.25'
memory: 64M
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:${SYNAPSE_PORT:-3708}/health"]
interval: 30s
timeout: 10s
retries: 3
networks:
- ${NETWORK_NAME:-nginx-network}
livekit:
image: livekit/livekit-server:latest
container_name: ${SERVICE_NAME:-messenger}-livekit
restart: unless-stopped
user: "${CURRENT_UID:-1000}:${CURRENT_GID:-1000}"
volumes:
- ./livekit/config.yaml:/etc/livekit.yaml:ro
- ./livekit/keys.yaml:/etc/livekit-keys.yaml:ro
env_file:
- .env
command: --config /etc/livekit.yaml --key-file /etc/livekit-keys.yaml
deploy:
resources:
limits:
cpus: '0.2'
memory: 128M
reservations:
cpus: '0.1'
memory: 64M
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:${LIVEKIT_HTTP_PORT:-7880}/"]
interval: 30s
timeout: 10s
retries: 3
networks:
- ${NETWORK_NAME:-nginx-network}
element-web:
image: vectorim/element-web:latest
container_name: ${SERVICE_NAME:-messenger}-element
restart: unless-stopped
volumes:
- ./element/config.json:/app/config.json:ro
- ./element/.well-known:/app/web/.well-known:ro
- element_nginx_conf:/etc/nginx/conf.d
env_file:
- .env
deploy:
resources:
limits:
cpus: '0.25'
memory: 32M
reservations:
cpus: '0.05'
memory: 16M
healthcheck:
test: ["CMD-SHELL", "wget -q -O- http://localhost:80/ > /dev/null || exit 1"]
interval: 30s
timeout: 10s
retries: 3
networks:
- ${NETWORK_NAME:-nginx-network}
volumes:
postgres_data:
redis_data:
element_nginx_conf:
networks:
nginx-network:
external: true