Book Image

Beginning DevOps with Docker

By : Joseph Muli
5 (1)
Book Image

Beginning DevOps with Docker

5 (1)
By: Joseph Muli

Overview of this book

Making sure that your application runs across different systems as intended is quickly becoming a standard development requirement. With Docker, you can ensure that what you build will behave the way you expect it to, regardless of where it's deployed. By guiding you through Docker from start to finish (from installation, to the Docker Registry, all the way through to working with Docker Swarms), we’ll equip you with the skills you need to migrate your workflow to Docker with complete confidence.
Table of Contents (7 chapters)

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.

  1. Create a new directory and name it django_docker.

  2. In the django-docker directory, create a new docker-compose.yml and add the information in the figure above, or in the django-docker-compose.yml script provided.

  3. Create a new Dockerfile and add the content in the Dockerfile script provided.

  4. Create a requirements file; simply copy the django-requirements.txt file provided.

  5. Run docker-compose up and observe the logs.

Notice that we are able to spin up both containers...