-
Notifications
You must be signed in to change notification settings - Fork 26
/
docker-compose.yml
62 lines (57 loc) · 1.38 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
version: "3.4"
services:
app:
container_name: app
build:
context: .
dockerfile: ./docker/Dockerfile
args:
- PORT=${PORT}
- NODE_ENV=${NODE_ENV}
user: node
working_dir: /home/node/app
env_file:
- ./.env
volumes:
- ./src:/home/node/app/src
ports:
- ${PORT}:${PORT}
depends_on:
- mongodb
networks:
- mynet
command: "npm run start:dev"
mongo-express:
image: mongo-express
ports:
- ${MONGO_EXPRESS_PORT}:8081
environment:
- ME_CONFIG_BASICAUTH_USERNAME=${MONGO_EXPRESS_USERNAME}
- ME_CONFIG_BASICAUTH_PASSWORD=${MONGO_EXPRESS_PASSWORD}
- ME_CONFIG_MONGODB_PORT=${MONGO_PORT}
- ME_CONFIG_MONGODB_ADMINUSERNAME=${MONGO_USERNAME}
- ME_CONFIG_MONGODB_ADMINPASSWORD=${MONGO_PASSWORD}
links:
- mongodb:mongo
depends_on:
- mongodb
networks:
- mynet
mongodb:
container_name: ${MONGO_HOST}
image: mongo:latest
environment:
- MONGO_INITDB_DATABASE=${MONGO_DATABASE_NAME}
- MONGO_INITDB_ROOT_USERNAME=${MONGO_USERNAME}
- MONGO_INITDB_ROOT_PASSWORD=${MONGO_PASSWORD}
ports:
- ${MONGO_PORT}:${MONGO_PORT}
volumes:
- ./docker/init-mongo.sh:/docker-entrypoint-initdb.d/init-mongo.sh
- mongo-storage:/data/db
networks:
- mynet
volumes:
mongo-storage: {}
networks:
mynet: