diff --git a/Tasks/6.Compose/README.md b/Tasks/6.Compose/README.md new file mode 100644 index 0000000..ad4d47e --- /dev/null +++ b/Tasks/6.Compose/README.md @@ -0,0 +1,6 @@ +# Practice - Docker Compose + +## Fix _docker-compose.yml_ and ensure the Voting app is working properly + - Review the Voting app [diagram](./voting-app.png) + - Fix [docker-compose.yml](./docker-compose.yml) + - Ensure the Voting app is working properly diff --git a/Tasks/6.Compose/docker-compose.yml b/Tasks/6.Compose/docker-compose.yml new file mode 100644 index 0000000..c282bb9 --- /dev/null +++ b/Tasks/6.Compose/docker-compose.yml @@ -0,0 +1,47 @@ +version: "2" + +services: + vote: + image: dockersamples/examplevotingapp_vote:latest + networks: + - front-end-subnet + ports: + - "80:80" + + # Hint: On which port the container is listening? + result: + image: dockersamples/examplevotingapp_result:latest + networks: + - back-end-subnet + ports: + - "8080:8080" + + # Hint: What network is going to be attached to the worker service? + worker: + image: dockersamples/examplevotingapp_worker:latest + depends_on: + - "redis" + - "db" + + # Hint: Should we care about the service name? + redis-mredis: + image: redis:3.2 + networks: + - front-end-subnet + + # Hint: environment variable should be set to allow connections without setting database password + db: + image: postgres:9.4 + networks: + - back-end-subnet + volumes: + - db-data:/var/lib/postgresql/data + +# Hint: Do we need volumes section? + +# Hint: Do we need special network drivers to run the app? +networks: + front-end-subnet: + driver: custom + back-end-subnet: + driver: bridge diff --git a/Tasks/6.Compose/voting-app.png b/Tasks/6.Compose/voting-app.png new file mode 100644 index 0000000..9410895 Binary files /dev/null and b/Tasks/6.Compose/voting-app.png differ