-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcompose.yaml
191 lines (178 loc) · 5.09 KB
/
compose.yaml
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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
version: "3.7"
services:
caddy:
image: aryaniyaps/securechat-caddy:latest
volumes:
- caddy_data:/data/caddy
environment:
DIGITALOCEAN_API_TOKEN: ${DIGITALOCEAN_API_TOKEN}
ACME_EMAIL: ${ACME_EMAIL}
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:80"]
interval: 5s
timeout: 1s
retries: 3
ports:
- "80:80"
- "443:443"
depends_on:
- app
- seaweedfs-s3
- ws-server
mongodb:
image: bitnami/mongodb:6.0
restart: unless-stopped
environment:
MONGODB_REPLICA_SET_MODE: primary
MONGODB_ADVERTISED_HOSTNAME: mongodb
MONGODB_ROOT_PASSWORD: ${MONGO_PASSWORD}
MONGODB_ROOT_USER: ${MONGO_USER}
MONGODB_REPLICA_SET_KEY: ${MONGO_REPLICA_SET_KEY}
volumes:
- mongodb_data:/bitnami/mongodb
healthcheck:
test: ["CMD", "mongo", "--eval", "db.adminCommand('ping')"]
interval: 30s
timeout: 10s
retries: 3
app:
image: aryaniyaps/securechat:latest
environment:
# Prisma
DATABASE_URL: ${DATABASE_URL}
# Next Auth
NEXTAUTH_SECRET: ${NEXTAUTH_SECRET}
NEXTAUTH_URL: ${NEXTAUTH_URL}
NEXTAUTH_URL_INTERNAL: ${NEXTAUTH_URL_INTERNAL}
# Next Auth Google Provider
GOOGLE_CLIENT_ID: ${GOOGLE_CLIENT_ID}
GOOGLE_CLIENT_SECRET: ${GOOGLE_CLIENT_SECRET}
# Next Auth Email Provider
EMAIL_SERVER: ${EMAIL_SERVER}
EMAIL_FROM: ${EMAIL_FROM}
# S3 Configuration
S3_ACCESS_KEY: ${S3_ACCESS_KEY}
S3_SECRET_KEY: ${S3_SECRET_KEY}
S3_END_POINT: ${S3_END_POINT}
S3_REGION: ${S3_REGION}
S3_AVATAR_BUCKET_NAME: ${S3_AVATAR_BUCKET_NAME}
S3_MEDIA_BUCKET_NAME: ${S3_MEDIA_BUCKET_NAME}
# RabbitMQ Configuration
RABBITMQ_URL: ${RABBITMQ_URL}
RABBITMQ_QUEUE_NAME: ${RABBITMQ_QUEUE_NAME}
depends_on:
- mongodb
- seaweedfs-s3
- ws-server
- rabbitmq
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/api/health"]
interval: 30s
timeout: 10s
retries: 3
ws-server:
image: aryaniyaps/securechat-ws-server:latest
restart: always
environment:
# only required in production environment
PHX_HOST: ${PHX_HOST}
RABBITMQ_URL: ${RABBITMQ_URL}
RABBITMQ_QUEUE_NAME: ${RABBITMQ_QUEUE_NAME}
TOKEN_VERIFY_URL: ${TOKEN_VERIFY_URL}
depends_on:
- rabbitmq
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:4000/health"]
interval: 30s
timeout: 10s
retries: 3
rabbitmq:
image: bitnami/rabbitmq:3.12
environment:
RABBITMQ_USERNAME: ${RABBITMQ_USERNAME}
RABBITMQ_PASSWORD: ${RABBITMQ_PASSWORD}
healthcheck:
test: rabbitmq-diagnostics -q ping
interval: 30s
timeout: 30s
retries: 3
seaweedfs-master:
image: chrislusf/seaweedfs:3.56
ports:
- "9333:9333"
- "19333:19333"
- "9324:9324"
command: "master -volumePreallocate=false -ip=seaweedfs-master -ip.bind=0.0.0.0 -metricsPort=9324"
# master servers store data by default to /data
volumes:
- seaweedfs_master_data:/data
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9333/dir/status"]
interval: 30s
timeout: 10s
retries: 3
seaweedfs-volume:
image: chrislusf/seaweedfs:3.56
ports:
- "8080:8080"
- "18080:18080"
- "9325:9325"
command: "volume -max=50 -mserver=seaweedfs-master:9333 -ip.bind=0.0.0.0 -port=8080 -metricsPort=9325"
# volume servers store data by default to /data
volumes:
- seaweedfs_volume_data:/data
depends_on:
- seaweedfs-master
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/status"]
interval: 30s
timeout: 10s
retries: 3
seaweedfs-filer:
image: chrislusf/seaweedfs:3.56
ports:
- "8888:8888"
- "18888:18888"
- "9326:9326"
command: "filer -master=seaweedfs-master:9333 -ip.bind=0.0.0.0 -metricsPort=9326"
tty: true
stdin_open: true
volumes:
- seaweedfs_filer_data:/data
depends_on:
- seaweedfs-master
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8888/status"]
interval: 30s
timeout: 10s
retries: 3
seaweedfs-s3:
image: aryaniyaps/securechat-weed-s3:latest
ports:
- "8333:8333"
- "9327:9327"
depends_on:
- seaweedfs-master
- seaweedfs-filer
# we are overriding the entrypoint, so we need to prefix our command with `weed`.
# this won't be necessary if we are using the default entrypoint.
command: "weed -v 9 filer -master=seaweedfs-master:9333 -s3 -metricsPort=9327 -ip.bind=0.0.0.0 -s3.config=/config.json"
environment:
S3_ACCESS_KEY: ${S3_ACCESS_KEY}
S3_SECRET_KEY: ${S3_SECRET_KEY}
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8333/status"]
interval: 30s
timeout: 10s
retries: 3
volumes:
seaweedfs_master_data:
driver: local
seaweedfs_filer_data:
driver: local
seaweedfs_volume_data:
driver: local
caddy_data:
driver: local
mongodb_data:
driver: local