Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Beginning DevOps with Docker

You're reading from   Beginning DevOps with Docker Automate the deployment of your environment with the power of the Docker toolchain

Arrow left icon
Product type Paperback
Published in May 2018
Publisher Packt
ISBN-13 9781789532401
Length 96 pages
Edition 1st Edition
Tools
Concepts
Arrow right icon
Author (1):
Arrow left icon
Joseph Muli Joseph Muli
Author Profile Icon Joseph Muli
Joseph Muli
Arrow right icon
View More author details
Toc

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...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime