Managing Multiple Containers and Distributed Application Bundles
This is the docker-compose.yml
for running a Django application. A similar application can be found in the docker-compose
documentation under the Django example.
Download the Django example from: ttps://docs.docker.com/compose/django/:
Note
Refer the complete code placed at Code/Lesson-2/django-docker-compose.yml
.
Go to https://goo.gl/H624J1 to access the code.
Improve a Docker Workflow
To give more context on how docker-compose
is involved and how it improves a Docker workflow.
- Create a new directory and name it
django_docker
. - In the
django-docker
directory, create a newdocker-compose.yml
and add the information in the figure above, or in thedjango-docker-compose.yml
script provided. - Create a new Dockerfile and add the content in the Dockerfile script provided.
- Create a requirements file; simply copy the
django-requirements.txt
file provided. - Run
docker-compose
up and observe the logs.
Notice that we are able to spin up both containers...