-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
60 lines (60 loc) · 1.47 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
version: '3.8'
services:
mongodb:
container_name: mongodb
restart: unless-stopped
env_file: ./.env
logging:
driver: none
image: mongo:5.0.3
environment:
- MONGO_INITDB_ROOT_USERNAME=$MONGODB_USER
- MONGO_INITDB_ROOT_PASSWORD=$MONGODB_PASSWORD
volumes:
- db:/data/db
- ./dbseed.gz:/dbseed.gz
- ./dbseed.sh:/docker-entrypoint-initdb.d/mongorestore.sh
mongodb-test:
container_name: mongodb-test
restart: unless-stopped
env_file: ./.env
logging:
driver: none
image: mongo:5.0.3
environment:
- MONGO_INITDB_ROOT_USERNAME=$MONGODB_USER
- MONGO_INITDB_ROOT_PASSWORD=$MONGODB_PASSWORD
volumes:
- ./dbseed.gz:/dbseed.gz
- ./dbseed.sh:/docker-entrypoint-initdb.d/mongorestore.sh
app:
depends_on:
- mongodb
- mongodb-test
container_name: node-app
restart: always
build: .
env_file: ./.env
volumes:
- avatars:/backend-app/__cache
- ./server:/backend-app/server
- ./package.json:/backend-app/package.json
ports:
- $NODE_LOCAL_PORT:$NODE_DOCKER_PORT
environment:
- DB_HOST=mongodb
- TEST_DB_HOST=mongodb-test
- DB_USER=$MONGODB_USER
- DB_PASSWORD=$MONGODB_PASSWORD
- DB_NAME=$MONGODB_DATABASE
- DB_PORT=27017
- SERVER_PORT=$NODE_LOCAL_PORT
- IS_DOCKER=true
- SECRET_KEY=$APP_SECRET
stdin_open: true
tty: true
links:
- mongodb
volumes:
db:
avatars: