Misael  Stark

Misael Stark

1619461440

A Makefile Example with Docker Compose Commands

In this example we are going to keep docker compose commands in Makefile and use make command to interact with them.

Available commands

All commands are listed below as follows. The TAG and ENV variables are compulsory unless they are set on server level.

make build TAG=latest ENV=dev

Builds all images.

make start TAG=latest ENV=dev

Starts all containers. The test and dev env will have application exposed to the host OS. In the case of prod and stag env, the application will be baked into the container so it won’t be exposed to the host OS.

make stop TAG=latest ENV=dev

Stops all containers.

#docker #linux

A Makefile Example with Docker Compose Commands