-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
39 lines (37 loc) · 924 Bytes
/
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
version: "3"
services:
# first service, the database
db:
image: mongo:latest
container_name: mongodb
environment:
- MONGO_INITDB_ROOT_USERNAME=${MONGODB_USER}
- MONGO_INITDB_ROOT_PASSWORD=${MONGODB_PASSWORD}
volumes:
- ./database:/data/db
ports:
- ${MONGODB_PORT}:27017
restart: unless-stopped
# an optional dbms to view the database besides app
db_view:
image: mongo-express
container_name: mongo-express
ports:
- 8081:8081
environment:
- ME_CONFIG_MONGODB_SERVER=${MONGODB_HOST}
- ME_CONFIG_MONGODB_ADMINUSERNAME=${MONGODB_USER}
- ME_CONFIG_MONGODB_ADMINPASSWORD=${MONGODB_PASSWORD}
depends_on:
- "to_db"
restart: on-failure
# app to insert to mongodb
to_db:
build:
context: .
dockerfile: Dockerfile
container_name: weather-pull
env_file:
- .env
depends_on:
- "db"