0

I am confused about how to run docker-compose.yml based applications on startup.

I'm running:

In two tmux sessions right now, via docker-compose up. But that doesn't help me when the machine reboots.

0

1 Answer 1

3

First you should enable your docker service to start on every boot by using sudo systemctl enable /usr/lib/systemd/system/docker.service.

Then you should start your docker-compose containers with docker-compose up -d.

-d, --detach               Detached mode: Run containers in the background,
                           print new container names. Incompatible with
                           --abort-on-container-exit.

(from: https://docs.docker.com/compose/reference/up/)

As far as I know containers running in the detached mode should also restart on a reboot.

If you still want to the the logs or if your containers are running and so on you should get familiar with the different compose CLI commands. See here

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .