Reader small image

You're reading from  Learn Docker - Fundamentals of Docker 19.x - Second Edition

Product typeBook
Published inMar 2020
PublisherPackt
ISBN-139781838827472
Edition2nd Edition
Tools
Right arrow
Author (1)
Dr. Gabriel N. Schenker
Dr. Gabriel N. Schenker
author image
Dr. Gabriel N. Schenker

Dr. Gabriel N. Schenker has more than 25 years of experience as an independent consultant, architect, leader, trainer, mentor, and developer. Currently, Gabriel works as Lead Solution Architect at Techgroup Switzerland. Prior to that, Gabriel worked as Lead Curriculum Developer at Docker and at Confluent. Gabriel has a Ph.D. in Physics, and he is a Docker Captain, a Certified Docker Associate, a Certified Kafka Developer and Operator, and an ASP Insider. When not working, Gabriel enjoys time with his wonderful wife Veronicah and his children.
Read more about Dr. Gabriel N. Schenker

Right arrow

Building and pushing an application

We have seen earlier that we can also use the docker-compose build command to just build the images of an application defined in the underlying docker-compose file. But to make this work, we'll have to add the build information to the docker-compose file. In the folder, we have a file, docker-compose.dev.yml, which has those instructions already added. It is basically a copy of the docker-compose.yml file we have used so far:

version: "2.4"
services:
web:
build: web
image: fundamentalsofdocker/ch11-web:2.0
ports:
- 80:3000
db:
build: db
image: fundamentalsofdocker/ch1-db:2.0
volumes:
- pets-data:/var/lib/postgresql/data

volumes:
pets-data:

Please note the build key for each service. The value of that key indicates the context or...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Learn Docker - Fundamentals of Docker 19.x - Second Edition
Published in: Mar 2020Publisher: PacktISBN-13: 9781838827472

Author (1)

author image
Dr. Gabriel N. Schenker

Dr. Gabriel N. Schenker has more than 25 years of experience as an independent consultant, architect, leader, trainer, mentor, and developer. Currently, Gabriel works as Lead Solution Architect at Techgroup Switzerland. Prior to that, Gabriel worked as Lead Curriculum Developer at Docker and at Confluent. Gabriel has a Ph.D. in Physics, and he is a Docker Captain, a Certified Docker Associate, a Certified Kafka Developer and Operator, and an ASP Insider. When not working, Gabriel enjoys time with his wonderful wife Veronicah and his children.
Read more about Dr. Gabriel N. Schenker