Docker Compose File
In this lesson we will look at the basics of creating a compose file.
Step 1: Setup your environment:
cd ~cd composegit clone https://github.com/nishanthkumarpathi/content-weather-app.git weather-app cd weather-app git checkout composeStep 2: Create a docker-compose.yml file:
touch docker-compose.ymldocker-compose.yml contents:
version: '3'
services:
weather-app:
build:
context: .
args:
- VERSION=v2.0
ports:
- "8081:3000"
environment:
- NODE_ENV=productionStep 3: Create the compose container:
docker-compose up -dList compose services:
docker-compose psStep 4: Verify the weather-app is working:
curl http://localhost:8081Step 5: Rebuild the image:
docker-compose buildStep 6: Rebuild the image with no cache:
docker-compose build --no-cacheLast updated