-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathdocker-compose.yml
90 lines (83 loc) · 2.91 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
version: "3.1"
services:
db:
image: mongo
restart: always
networks:
- db_network # for API reqs
environment:
MONGO_INITDB_ROOT_USERNAME: $DB_USERNAME
MONGO_INITDB_ROOT_PASSWORD: $DB_PASSWORD
MONGO_INITDB_DATABASE: $MONGO_INITDB_DATABASE
volumes:
- db_vol:/data/db
db_interface:
image: mongo-express
restart: always
environment:
ME_CONFIG_MONGODB_ADMINUSERNAME: $DB_USERNAME
ME_CONFIG_MONGODB_ADMINPASSWORD: $DB_PASSWORD
ME_CONFIG_SITE_BASEURL: /db_interface/
ME_CONFIG_MONGODB_SERVER: db
networks:
- db_network # access db
- web_network # access the interface
depends_on:
- db
backend:
build: ./backend
command: --log-level debug
restart: always
volumes:
- ./backend:/app
environment:
PORT: 5000
DEBUG: $DEBUG
SECRET_KEY: $SECRET_KEY
DATABASE_URL: $DATABASE_URL
depends_on:
- db
networks:
- db_network # for data fetching/upload
- web_network # for web API
frontend:
build:
context: ./frontend
args:
DEBUG: $DEBUG
NODE_ENV: $NODE_ENV
entrypoint: ./entrypoint.sh
restart: unless-stopped
volumes:
- web-root:/home/node/app/dist
- ./frontend:/home/node/app
- /home/node/app/node_modules
environment:
NODE_ENV: $NODE_ENV
PORT: 8080
DEBUG: $DEBUG
depends_on:
- backend
networks:
- web_network
nginx:
image: nginx:latest
ports:
- 8000:80
volumes:
- web-root:/var/www/html
- ./config/nginx:/etc/nginx/conf.d/
depends_on:
- frontend
- backend
- db_interface
networks:
- web_network
networks:
web_network:
driver: bridge
db_network:
driver: bridge
volumes:
web-root:
db_vol: