i have to run some shell script which creates some certificates before the node app.js command is called in Dockerfile. how can i do it so it won't exit after running a shell script and will continue to run the node app.js web app.
What I have done in the past is have my entrypoint defined in the Dockerfile be a shell script and then run the node command from within that script.
So in my Dockerfile I have this -
ENTRYPOINT ["./docker-start.sh"]
And my docker-start.sh script contains this:
#! /bin/bash
# Initialization logic can go here
echo "Starting node..."
node start.js $* # The $* allows me to pass command line arguments that were passed to the docker run command.
# Cleanup logic can go here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With