Launch a Development Environment with Docker Compose
Learn how to launch your app with Docker Compose.
We'll cover the following...
Docker Compose
Docker Compose can override the image’s default production settings to launch a container in development mode. We will use the following docker-compose.yml
:
Press + to interact
version: '3'services:nodehello:environment:- NODE_ENV=developmentbuild:context: ./dockerfile: Dockerfilecontainer_name: nodehellovolumes:- ./:/home/node/appports:- "3000:3000"- "9229:9229"command: /bin/sh -c 'npm install && npm run debug'
Before we referenced a specific image:
from Docker Hub. In this file, a build:
option is used to create an image from a Dockerfile
:
- The
context:
is the relative path to the location of your
Access this course and 1400+ top-rated courses and projects.