-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
176 lines (166 loc) · 4.28 KB
/
Copy pathdocker-compose.yml
File metadata and controls
176 lines (166 loc) · 4.28 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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
services:
postgres:
image: postgres:16-alpine
environment:
POSTGRES_USER: chat
POSTGRES_PASSWORD: chat
POSTGRES_DB: chat
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U chat"]
interval: 5s
timeout: 5s
retries: 10
ejabberd:
image: ghcr.io/processone/ejabberd:latest
environment:
ERLANG_NODE: ejabberd@ejabberd
volumes:
- ./ejabberd/ejabberd.yml:/opt/ejabberd/conf/ejabberd.yml:ro
- ejabberd_data:/opt/ejabberd/database
ports:
- "5222:5222" # XMPP client-to-server
- "5269:5269" # XMPP server-to-server (federation)
- "5275:5275" # External component port (bridge)
- "5280:5280" # ejabberd admin HTTP API
networks:
default:
ipv4_address: 172.28.0.10
extra_hosts:
- "xmpp-b.localhost:172.28.0.11"
healthcheck:
test: ["CMD", "ejabberdctl", "status"]
interval: 10s
timeout: 10s
retries: 12
start_period: 30s
minio:
image: minio/minio:latest
command: server /data --console-address ":9001"
environment:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
volumes:
- minio_data:/data
ports:
- "9000:9000" # S3 API
- "9001:9001" # MinIO console
healthcheck:
test: ["CMD", "mc", "ready", "local"]
interval: 5s
timeout: 5s
retries: 10
minio-init:
image: minio/mc:latest
depends_on:
minio:
condition: service_healthy
entrypoint: >
/bin/sh -c "
mc alias set local http://minio:9000 minioadmin minioadmin &&
mc mb --ignore-existing local/uploads
"
restart: "no"
pgadmin:
image: dpage/pgadmin4:latest
environment:
PGADMIN_DEFAULT_EMAIL: admin@admin.com
PGADMIN_DEFAULT_PASSWORD: admin
ports:
- "5050:80"
depends_on:
postgres:
condition: service_healthy
backend:
build:
context: ./backend
dockerfile: Dockerfile
environment:
DATABASE_URL: postgresql://chat:chat@postgres:5432/chat
JWT_SECRET: supersecretjwtkey_change_in_prod
PORT: 4000
UPLOAD_DIR: /uploads
FRONTEND_URL: http://localhost:3000
XMPP_ENABLED: "true"
XMPP_HOST: xmpp.localhost
XMPP_COMPONENT_DOMAIN: chat.xmpp.localhost
XMPP_COMPONENT_SECRET: bridgesecret
EJABBERD_HOST: ejabberd
EJABBERD_COMPONENT_PORT: "5275"
EJABBERD_API_URL: http://ejabberd:5280
S3_ENDPOINT: http://minio:9000
S3_BUCKET: uploads
S3_ACCESS_KEY: minioadmin
S3_SECRET_KEY: minioadmin
S3_REGION: us-east-1
restart: unless-stopped
ports:
- "4000:4000"
depends_on:
postgres:
condition: service_healthy
minio:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "wget -qO- http://localhost:4000/healthz || exit 1"]
interval: 5s
timeout: 5s
retries: 20
start_period: 30s
db-seed:
image: postgres:16-alpine
depends_on:
backend:
condition: service_healthy
environment:
PGHOST: postgres
PGUSER: chat
PGPASSWORD: chat
PGDATABASE: chat
volumes:
- ./backend/scripts/seed.sql:/seed.sql:ro
- ./scripts/seed-entrypoint.sh:/seed-entrypoint.sh:ro
entrypoint: ["sh", "/seed-entrypoint.sh"]
restart: "no"
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
restart: unless-stopped
ports:
- "3000:3000"
depends_on:
backend:
condition: service_healthy
# Second ejabberd instance for federation testing (separate XMPP domain)
ejabberd-b:
image: ghcr.io/processone/ejabberd:latest
profiles:
- federation
environment:
ERLANG_NODE: ejabberd@ejabberd-b
volumes:
- ./ejabberd/ejabberd-b.yml:/opt/ejabberd/conf/ejabberd.yml:ro
- ejabberd_b_data:/opt/ejabberd/database
ports:
- "5223:5222"
- "5270:5269"
- "5281:5280"
networks:
default:
ipv4_address: 172.28.0.11
extra_hosts:
- "xmpp.localhost:172.28.0.10"
networks:
default:
ipam:
config:
- subnet: 172.28.0.0/16
volumes:
postgres_data:
minio_data:
ejabberd_data:
ejabberd_b_data: