-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
41 lines (36 loc) · 845 Bytes
/
docker-compose.yml
File metadata and controls
41 lines (36 loc) · 845 Bytes
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
version: '3.8'
services:
notes-app:
build:
context: .
dockerfile: Dockerfile
image: notes-app
container_name: notes-app-container
ports:
- "8080:8080"
environment:
SPRING_DATA_MONGODB_URI: mongodb://172.17.0.1:27017/notes
depends_on:
- mongo-setup
mongo-setup:
container_name: mongo-setup-container
image: mongo:5
restart: no
volumes:
- ./mongo-setup.sh:/scripts/mongo-setup.sh
entrypoint: [ "/scripts/mongo-setup.sh" ]
depends_on:
- mongodb
mongodb:
image: mongo:5
container_name: mongodb-container
restart: always
ports:
- "27017:27017"
environment:
MONGO_INITDB_DATABASE: notes
volumes:
- mongodb_data:/data/db
entrypoint: ["mongod", "--bind_ip_all", "--replSet", "rs0"]
volumes:
mongodb_data: