How to keep a docker container running as a daemon

I bet this situation would be so easy to you, but I get stuck here:

I have a gitlab-ci.yml file in my project which adopts a docker runner.
The deamon process of my app is started during the deploy stage. when the deploy stage finishes, the docker container stops running, but what I want is to keep it running.

I tried to use this as the last script of the deploy stage: tail -f /dev/null, but it will block the CI stage that it won’t finish.

I switched from ssh executor to docker executor. If the ssh executor is used, it would be easy with:
docker run -d tail -f /dev/null
docker exec -it bash