(realised I can’t put a link into this post) - I used the official Deploy Seafile with Docker from the seafile admin manual found on this site.
All working on Ubuntu 20.04.01. In fact, I’m delighted with it.
I am using a reverse proxy also in another docker.
I have a simple question - how do I get the seafile docker (based on the instructions above that I followed) which uses docker-compose to get my docker up and running to automatically start upon reboot?
The proxy one auto starts so I just need a solution to the seafile docker based on how I have installed it with those instructions. Thanks in advance for anyone who can tell me the solution!
copy and paste (but edit it to suit your directory) the below:
[Unit]
Description=Docker Compose Application Service
Requires=docker.service
After=docker.service
[Service]
Type=oneshot
RemainAfterExit=yes
WorkingDirectory=/home/user/sea-file #this is the directory where your docker-compose.yml file is
ExecStart=/usr/bin/docker-compose up -d
ExecStop=/usr/bin/docker-compose down
TimeoutStartSec=0
[Install]
WantedBy=multi-user.target #END
don’t copy the # comments - I just put the note about the directory in there for your benefit and also made it clear when the last line is in the file - you don’t need #END.
instead up -d and down, which will destroy and rebuild the whole stack on every reboot, I would make use
of stop & start commands to avoid any unwanted auto upgrades…
Actually, use it. Don’t know what happened for the op but this is the simplest and “docker” way. always or unless-stopped policies both restart container after a reboot.