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
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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.