How to run python scripts and do CMD in Dockerfile for the docker container
<p>I have an image with a custom Dockerfile. When I start the container, I want to run <code>CMD ["npm, "start"]</code> but right before that, I need to run three scripts.</p>

<p>I've tried:</p>

<p>1)putting the python scripts followed by npm start in a .sh script, and running <code>CMD ["script-location/script.sh"]</code></p>

<p>2) calling <code>CMD ["script", "npm", "start"]</code></p>

<p>none of this is working, and after the python scripts run, the container shuts down instead of running npm start and listening at a port. Not sure how to fix this.</p>

<p>the bash script I have is:</p>

<pre><code>#!/bin/bash

echo starting to run runtime_properties...
python /var/first_script.py
echo finished runtime_properties

echo starting to run runtime_properties...
python /var/second_script.py
echo finished runtime_files

echo starting to run config-dns-props...
python /var/third_script.py
echo finishing config runtime files

echo starting to run npm start...
npm start
</code></pre>

<p>Had to run <code>ENTRYPOINT ["script-path/script.sh"]</code></p>

python docker npm dockerfile