-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdocker-compose.yml
72 lines (64 loc) · 1.73 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
version: "3.8"
services:
nextjs:
ports:
- 3000:3000
build:
context: ./
dockerfile: Dockerfile
volumes:
- images:/usr/src/app/public/bilder
- next:/usr/src/app/.next
environment:
- DATABASE_URL=mongodb://mongo:27017/db
- PASSWORD=123
mongo:
image: mongo:7.0
container_name: mongo
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',priority:1},{_id:1,host:'host.docker.internal:27018',priority:0.5},{_id:2,host:'host.docker.internal:27019',priority:0.5}]}) }" | mongosh --port 27017 --quiet
interval: 5s
timeout: 30s
start_period: 0s
retries: 30
volumes:
- "./data/originalData:/data/db"
- "./data/originalData_config:/data/configdb"
mongo2:
image: mongo:7.0
command: ["--replSet", "rs0", "--bind_ip_all", "--port", "27018"]
ports:
- 27018:27018
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
- "./data/mongo2_data:/data/db"
- "./data/mongo2_config:/data/configdb"
mongo3:
image: mongo:7.0
command: ["--replSet", "rs0", "--bind_ip_all", "--port", "27019"]
ports:
- 27019:27019
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
- "./data/mongo3_data:/data/db"
- "./data/mongo3_config:/data/configdb"
volumes:
images:
next:
originalData:
mongo2_data:
mongo3_data:
originalData_config:
mongo2_config:
mongo3_config:
networks:
default:
common.network:
driver: bridge