The only thing you need to restart itself is restart: always
in yml .
So if your docker-compose.yml
is this:
version: '2'
services:
web:
build: .
ports:
- "5000:5000"
volumes:
- .:/code
redis:
image: "redis:alpine"
Reach with you to put restart: always
in the container :
version: '2'
services:
web:
restart: always
build: .
ports:
- "5000:5000"
volumes:
- .:/code
redis:
image: "redis:alpine"
Then, in the folder, you make docker-compose up -d
(so that it starts as a separate process) and voila, every time you restart Ubuntu , the container starts.