forked from hudy9x/namviek
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
80 lines (75 loc) · 1.83 KB
/
docker-compose.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
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
services:
backend:
container_name: backend
build:
context: .
dockerfile: ./docker/Dockerfile
args:
- ENV_FILE=.env.local
image: namviek
env_file:
- .env.local
environment:
- REDIS_HOST=redis:6379
- MONGODB_URL=mongodb://mongodb:27017/namviek?replicaSet=rs0&authSource=admin&directConnection=true
ports:
- '3333:3333'
command: /bin/sh -c "./docker/be-entrypoint.sh && yarn backend"
healthcheck:
test: curl --fail http://localhost:3333 || exit 1
interval: 30s
timeout: 10s
retries: 5
start_period: 30s
depends_on:
- mongodb
- redis
networks:
- namviek-network
frontend:
container_name: frontend
image: namviek
env_file:
- .env.local
ports:
- '3000:3000'
command: /bin/sh -c "./docker/fe-entrypoint.sh && yarn prod:fe"
depends_on:
- backend
networks:
- namviek-network
redis:
container_name: redis
image: 'redis:alpine'
ports:
- '6379:6379'
networks:
- namviek-network
mongodb:
container_name: mongodb
image: 'mongo:latest'
command: ['--replSet', 'rs0', '--bind_ip_all', '--port', '27017']
ports:
- '27017:27017'
extra_hosts:
- 'host.docker.internal:host-gateway'
healthcheck:
test: echo "try { rs.status() } catch (err) { rs.initiate({_id:'rs0',members:[{_id:0,host:'host.docker.internal:27017'}]}) }" | mongosh --port 27017 --quiet
interval: 5s
timeout: 30s
start_period: 0s
start_interval: 1s
retries: 30
environment:
MONGO_INITDB_DATABASE: namviek
volumes:
- mongodb-data:/data/db
- mongodb-config:/data/configdb
networks:
- namviek-network
volumes:
mongodb-data:
mongodb-config:
networks:
namviek-network:
driver: bridge