Starts nginx inside the bash script
This commit is contained in:
parent
7dec58f54c
commit
47ddd834c7
|
@ -26,12 +26,9 @@ RUN chmod +x ./entrypoint.sh
|
|||
|
||||
# The entrypoint.sh script will run after the container finishes starting.
|
||||
# Substitutes environment variables in nginx configuration and index.html,
|
||||
# then reloads nginx.
|
||||
# then starts/reloads nginx.
|
||||
ENTRYPOINT ["./entrypoint.sh", \
|
||||
"/etc/nginx/html/index.html,/etc/nginx/conf.d/default.conf", \
|
||||
"PRODUCTION,API_URL,IRB_URL,HOME_ROUTE,BASE_HREF,PORT0", \
|
||||
"/etc/nginx/html", \
|
||||
"true"]
|
||||
|
||||
### STAGE 3: Profit! ###
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
|
|
|
@ -89,9 +89,16 @@ done
|
|||
if [ $num_args -ge 4 ] && [ "$4" == "true" ]; then
|
||||
# Check to see if nginx command is available
|
||||
if hash nginx 2> /dev/null; then
|
||||
echo "Reloading nginx..."
|
||||
# Check to see if nginx is already running
|
||||
if [ -e /var/run/nginx.pid ]; then
|
||||
echo "nginx is currently running. Reloading nginx..."
|
||||
exec nginx -s reload
|
||||
echo "nginx reloaded."
|
||||
else
|
||||
echo "nginx is not yet running. Starting nginx..."
|
||||
exec nginx -g 'daemon off;'
|
||||
echo "nginx started."
|
||||
fi
|
||||
else
|
||||
echo "nginx command not found on this system."
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue