Skip to content

Commit

Permalink
Now using ENTRYPOINT to improve launching with commands
Browse files Browse the repository at this point in the history
  • Loading branch information
erseco committed Jun 28, 2024
1 parent 6c1a8b2 commit f408617
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,10 @@ WORKDIR /var/www/html
EXPOSE 8080

# Let runit start nginx & php-fpm
CMD [ "/bin/docker-entrypoint.sh" ]
# Ensure /bin/docker-entrypoint.sh is always executed
ENTRYPOINT ["/bin/docker-entrypoint.sh"]
CMD [""]


# Configure a healthcheck to validate that everything is up&running
HEALTHCHECK --timeout=10s CMD curl --silent --fail http://127.0.0.1:8080/fpm-ping || exit 1
Expand Down
5 changes: 5 additions & 0 deletions rootfs/bin/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ for _srv in $(ls -1 /etc/service); do
sv status $_srv
done

# If there are additional arguments, execute them
if [ $# -gt 0 ]; then
exec "$@"
fi

# catch shutdown signals
trap shutdown SIGTERM SIGHUP SIGQUIT SIGINT
wait $RUNSVDIR
Expand Down

0 comments on commit f408617

Please sign in to comment.