Skip to content

Commit ed73c0c

Browse files
authored
Merge pull request dockersamples#40 from ManoMarks/master
Adding additional compose file
2 parents 4065c3e + 5181547 commit ed73c0c

File tree

2 files changed

+62
-10
lines changed

2 files changed

+62
-10
lines changed

docker-compose-simple.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
version: "2"
2+
3+
services:
4+
vote:
5+
build: ./vote
6+
command: python app.py
7+
volumes:
8+
- ./vote:/app
9+
ports:
10+
- "5000:80"
11+
12+
redis:
13+
image: redis:alpine
14+
ports: ["6379"]
15+
16+
worker:
17+
build: ./worker
18+
19+
db:
20+
image: postgres:9.4
21+
22+
result:
23+
build: ./result
24+
command: nodemon --debug server.js
25+
volumes:
26+
- ./result:/app
27+
ports:
28+
- "5001:80"
29+
- "5858:5858"

docker-compose.yml

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,9 @@ services:
88
- ./vote:/app
99
ports:
1010
- "5000:80"
11-
12-
redis:
13-
image: redis:alpine
14-
ports: ["6379"]
15-
16-
worker:
17-
build: ./worker
18-
19-
db:
20-
image: postgres:9.4
11+
networks:
12+
- front-tier
13+
- back-tier
2114

2215
result:
2316
build: ./result
@@ -27,3 +20,33 @@ services:
2720
ports:
2821
- "5001:80"
2922
- "5858:5858"
23+
networks:
24+
- front-tier
25+
- back-tier
26+
27+
worker:
28+
build: ./worker
29+
networks:
30+
- back-tier
31+
32+
redis:
33+
image: redis:alpine
34+
container_name: redis
35+
ports: ["6379"]
36+
networks:
37+
- back-tier
38+
39+
db:
40+
image: postgres:9.4
41+
container_name: db
42+
volumes:
43+
- "db-data:/var/lib/postgresql/data"
44+
networks:
45+
- back-tier
46+
47+
volumes:
48+
db-data:
49+
50+
networks:
51+
front-tier:
52+
back-tier:

0 commit comments

Comments
 (0)