@@ -0,0 +1,29 @@
+version: "2"
+
+services:
+ vote:
+ build: ./vote
+ command: python app.py
+ volumes:
+ - ./vote:/app
+ ports:
+ - "5000:80"
+ redis:
+ image: redis:alpine
+ ports: ["6379"]
+ worker:
+ build: ./worker
+ db:
+ image: postgres:9.4
+ result:
+ build: ./result
+ command: nodemon --debug server.js
+ - ./result:/app
+ - "5001:80"
+ - "5858:5858"
@@ -8,16 +8,9 @@ services:
- ./vote:/app
ports:
- "5000:80"
-
- redis:
- image: redis:alpine
- ports: ["6379"]
- worker:
- build: ./worker
- db:
- image: postgres:9.4
+ networks:
+ - front-tier
+ - back-tier
result:
build: ./result
@@ -27,3 +20,33 @@ services:
- "5001:80"
- "5858:5858"
+ container_name: redis
+ container_name: db
+ - "db-data:/var/lib/postgresql/data"
+volumes:
+ db-data:
+networks:
+ front-tier:
+ back-tier: