You can run 2 processes in foreground by using wait
. Just make a bash script with the following content. Eg start.sh
:
# runs 2 commands simultaneously:
mongod & # your first application
P1=$!
python script.py & # your second application
P2=$!
wait $P1 $P2
In your Dockerfile, start it with
CMD bash start.sh