diff --git a/docker-compose-simple.yml b/docker-compose-simple.yml new file mode 100644 index 0000000..289b9d2 --- /dev/null +++ b/docker-compose-simple.yml @@ -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 + volumes: + - ./result:/app + ports: + - "5001:80" + - "5858:5858" diff --git a/docker-compose.yml b/docker-compose.yml index 289b9d2..efc3e6f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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: ports: - "5001:80" - "5858:5858" + networks: + - front-tier + - back-tier + + worker: + build: ./worker + networks: + - back-tier + + redis: + image: redis:alpine + container_name: redis + ports: ["6379"] + networks: + - back-tier + + db: + image: postgres:9.4 + container_name: db + volumes: + - "db-data:/var/lib/postgresql/data" + networks: + - back-tier + +volumes: + db-data: + +networks: + front-tier: + back-tier: \ No newline at end of file