-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.dev.yml
58 lines (53 loc) · 1.26 KB
/
docker-compose.dev.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
version: "3.9"
services:
backend:
build:
context: ./
dockerfile: Dockerfile
container_name: backend_api
command: "python backend/server/dev.py"
restart: always
volumes:
- ./:/template_be/
ports:
- "2555:80"
env_file:
- ./.env
environment:
MONGODB_URI: mongodb://${MONGODB_USERNAME}:${MONGODB_PASSWORD}@db:27017
depends_on:
db:
condition: service_healthy
db:
image: mongo:5.0
container_name: backend_mongodb
env_file:
- ./.env
environment:
MONGO_INITDB_ROOT_USERNAME: ${MONGODB_USERNAME}
MONGO_INITDB_ROOT_PASSWORD: ${MONGODB_PASSWORD}
volumes:
- mongodb_data:/data/db
ports:
- "45048:27017"
healthcheck:
test: [ "CMD", "mongo", "--eval", "db.adminCommand('ping')" ]
interval: 10s
timeout: 10s
retries: 20
db_admin:
image: mongo-express
container_name: backend_mongodb_express
env_file:
- ./.env
environment:
ME_CONFIG_MONGODB_ADMINUSERNAME: ${MONGODB_ADMIN_USERNAME}
ME_CONFIG_MONGODB_ADMINPASSWORD: ${MONGODB_ADMIN_PASSWORD}
ME_CONFIG_MONGODB_SERVER: db
ports:
- "5008:8081"
depends_on:
db:
condition: service_healthy
volumes:
mongodb_data: