How to start a python script that launches master using Docker
I have a python file that executes a bash script. That bash script starts a ros master by running
roslaunch rosbridge_server rosbridge_websocket.launch
Python file works as expected when ran on its own.
Now I want to start that python script using a Dockerfile (or Docker container). I've seen this tutorial but this doesn't help me as the master is started from the container itself.
My question is how can I run the python script inside a Dockerfile and somehow include the ROS noetic module inside the container to let the script know about it?
This is the Dockerfile I have at the moment:
FROM python:3
COPY . .
RUN pip install -r requirements.txt
ENTRYPOINT ["/bin/bash", "-c", "source ../setup.bash"]
CMD [ "python", "my_file.py" ]