Starting zotonic in docker with ./start-docker.sh and at reboot

Hi all. It’s nice to be here.

I’m very new to erlang.

I have installed zotonic CMS directly on linux host and also by using docker. While using docker, how can I restart zotonic when I need to, without creating new zotonic docker container? ./start-docker.sh always creates a new container.

Secondly, I couldn’t find a way to restart zotonic in docker when the server is reboot. The best success that I had was to start the container automatically but not the zotonic in it.

Kindly guide me. Thank you.

This is just a basic docker usage question. Once your container has been built (with the start-docker.sh script) you can stop and start the container with docker start <container name or id>, or replace start with stop to stop the container. If you don’t know the name or id of the zotonic container you can use docker container ls -a to see a list of all containers on your system.

As far as starting at boot, I would recommend creating a systemd init script. You can research this on your own, just have the script execute the docker start command for your container. I strongly recommend running the container as a user other than root (which is the systemd default if none is specified).

This is just a basic docker usage question. Once your container has been built (with the start-docker.sh script) you can stop and start the container with docker start <container name or id>, or replace start with stop to stop the container. If you don’t know the name or id of the zotonic container you can use docker container ls -a to see a list of all containers on your system.

As far as starting at boot, I would recommend creating a systemd init script. You can research this on your own, just have the script execute the docker start command for your container. I strongly recommend running the container as a user other than root (which is the systemd default if none is specified). It looks like you will need to use 2 commands to get zotonic running, after the docker start zotonic (for example) you need to use docker exec zotonic ./start.sh to run the start script inside the container.

Sorry about the double post, was trying to edit on my phone, but my fat thumbs got the better of me.