forked from kleingtm/docker-nginx-node-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
54 lines (49 loc) · 1.27 KB
/
docker-compose.yml
File metadata and controls
54 lines (49 loc) · 1.27 KB
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
flask-api:
restart: on-failure:10
build: ./flask-api
expose:
- "5000"
env_file: .env
links:
- mongo-db
command: uwsgi --ini /flask-api/uwsgi.ini --async 12 --ugreen
container_name: flask-api
node-api:
restart: on-failure:10
build: ./node-api
expose:
- "3000"
ports:
- "5858:5858"
env_file: .env
links:
- mongo-db
#command: pm2 start /node-api/node-api.json --no-daemon
command: node --debug /node-api/bin/node-api.js
#command: node-debug /node-api/bin/node-api.js
#command: nodemon --debug /node-api/node-api.js --watch /node-api
container_name: node-api
nginx:
restart: always
build: ./nginx/
ports:
- "80:80"
links:
# nginx has to link to flask-api (not vice-versa) so that nginx/sites-enabled/default has access to flask-api by service name (acts as host dns).
# each docker container has a seperate ip address below the docker-machine host, so you have to link containers to correctly pass to upstream flask port
- flask-api:flask-api
- node-api:node-api
container_name: nginx
mongo-data:
image: mongo:latest
volumes:
- /data/db
command: "true"
container_name: mongo-data
mongo-db:
image: mongo:latest
volumes_from:
- mongo-data
ports:
- "27017:27017"
container_name: mongo-db