Gitlab-CI execute command in Docker Container

Hello together,
after reading through a lot of docs and threads I still did not come to a conclusion.

My goal is the following:
I have a php docker container permanently running on our dev server (using docker-compose). I want to execute a php file inside this already running container using gitlab-ci.yml.
When I try to connect to the server from my runner over SSH and then try something like
sudo docker exec -d <container> bash
I get error that this is not a tty.
I also installed a new runner on the dev server which has a docker executor. But I could not figure out how to get this to do what I want.

Any ideas how to achieve this?

Thank you in advance