Skip to content

Commit

Permalink
feat: add compose task
Browse files Browse the repository at this point in the history
  • Loading branch information
Tsvetan Ivanov committed May 9, 2020
1 parent fb4deaf commit f19c61a
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Tasks/6.Compose/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# 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)
- Execute command: docker-compose up
- Ensure the Voting app is working properly
47 changes: 47 additions & 0 deletions Tasks/6.Compose/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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
Binary file added Tasks/6.Compose/voting-app.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f19c61a

Please sign in to comment.