-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
51 lines (45 loc) · 1.1 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
# version: '3.8'
# services:
# mongodb:
# image: mongo:latest
# container_name: mongodb
# restart: always
# environment:
# MONGO_INITDB_ROOT_USERNAME: ${MONGO_INITDB_ROOT_USERNAME}
# MONGO_INITDB_ROOT_PASSWORD: ${MONGO_INITDB_ROOT_PASSWORD}
# MONGO_INITDB_DATABASE: ${MONGO_INITDB_DATABASE}
# ports:
# - "27017:27017"
# volumes:
# - mongo_data:/data/db
# - ./init-mongo.js:/docker-entrypoint-initdb.d/init-mongo.js:ro
# volumes:
# mongo_data:
version: '3.8'
services:
app:
build: .
container_name: fastapi_app
ports:
- "8000:8000"
environment:
- MONGO_INITDB_DATABASE=myDatabase
- MONGO_INITDB_ROOT_USERNAME=myUser
- MONGO_INITDB_ROOT_PASSWORD=myP@ssw0rd
depends_on:
- mongo
volumes:
- .:/app
mongo:
image: mongo:latest
container_name: mongo_db
ports:
- "27017:27017"
environment:
- MONGO_INITDB_DATABASE=myDatabase
- MONGO_INITDB_ROOT_USERNAME=myUser
- MONGO_INITDB_ROOT_PASSWORD=myP@ssw0rd
volumes:
- mongo_data:/data/db
volumes:
mongo_data: