-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.prod.yml
51 lines (48 loc) · 1.25 KB
/
docker-compose.prod.yml
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
services:
app:
build:
context: .
dockerfile: Dockerfile.prod
args:
- VITE_API_BASE_URL=/api
ports:
- "5000:5000"
environment:
- NODE_ENV=production
- MONGODB_URI=mongodb://mongodb:27017/mellifera
- VITE_API_BASE_URL=/api
depends_on:
- mongodb
healthcheck:
test: ["CMD", "node", "-e", "require('http').get('http://localhost:5000/health', (res) => { process.exit(res.statusCode === 200 ? 0 : 1) })"]
interval: 30s
timeout: 10s
retries: 3
secrets:
- db_password
mongodb:
image: mongo:5
ports:
- "27017:27017"
volumes:
- mongodb_data_prod:/data/db
healthcheck:
test: ["CMD", "mongo", "--eval", "db.adminCommand('ping')"]
interval: 30s
timeout: 10s
retries: 3
environment:
- MONGO_INITDB_ROOT_USERNAME_FILE=/run/secrets/mongo_root_username
- MONGO_INITDB_ROOT_PASSWORD_FILE=/run/secrets/mongo_root_password
secrets:
- mongo_root_username
- mongo_root_password
volumes:
mongodb_data_prod:
secrets:
db_password:
file: ./secrets/db_password.txt
mongo_root_username:
file: ./secrets/mongo_root_username.txt
mongo_root_password:
file: ./secrets/mongo_root_password.txt