I have a dockerized nginx that works great if I run a shell, but (naturally enough) if I give "nginx start" itself as the entrypoint, it just daemonizes and exits immediately for lack of a process to wait for.
My inclination is just to do something like this:
pid=$(cat /run/nginx.pid)
while ps ax | awk '{print $1}' | grep -q $pid; do
sleep 60
done
Though this seems like quite a hack. But when I google for examples, I see people running bash.
Any pointers?
Well I opened up the Dockerfile from the official nginx container for you and saw they use:
CMD ["nginx", "-g", "daemon off;"]
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