Skip to content
mengfung.com
writing

Using Docker-compose

 ·  1 min read

Commands for docker-compose

You will need a YAML file that contains your stack.

# create containers but do not start them up
docker-compose -f stack.yml up --no-start
# start containers
docker-compose -f stack.yml start

Stack file

# simple alpine container
services:
alpine:
container_name: alpine-server
image: alpine:latest
restart: always

A little more complex example: https://gist.github.com/mfung/9b0fd65ccc793c7b1ec44dfb2deb370d