.gitlab-ci.yaml nohup

Hi,

with using the nohup ... & pattern you move the command into the background and leave it running even if the shell is detected/destroyed. If you continue running the jobs more than once, you get quite a few processes binding ports and consuming resources, for example the runserver on port 8000.

Imho your script needs to check whether old commands are still running before triggering a new deployment. Also, I would recommend to use a different method to deploy and run services on a VM/container.

supervisorctl in containers, systemd services work really good in this regard.

Another idea: You build your environment with containers and docker-compose running as daemon. Each time you run a deployment, the previous stages have built a new container image, pushed it to the registry and the deployment step just pulls the registry and invokes docker-compose restart then.

Cheers,
Michael