I have three docker containers. First container is a Wordpress container which starts a wordpress instance. Second container is a selenium server container created from selenium/standalone-chrome
image which is supposed to do some initial setup of the wordpress via UI interactions. I have a python script that has all the commands to send to the selenium server. I am running this script in a python container as the third container. All the containers are spawned using docker-compose
and are in the same network, so that communication can happen.
Once the python container is finished running the script it exits, however the selenium server and the wordpress container keep running. Once I am done with the script, I want to stop the selenium server container as well but keep the wordpress container running.
I had a thought to run a script inside the python container as entrypoint which first executes the script and then issues a command to stop the other container but for that I guess the python container should also have docker available inside it. So, I think this will not work. Is there a simple way to achieve this?