[deploy] new entrypoint design

This commit is contained in:
Aleksandr Soloshenko 2025-07-26 07:32:38 +07:00 committed by Aleksandr
parent c6fe84d730
commit a803b26472
2 changed files with 11 additions and 4 deletions

View File

@ -44,6 +44,10 @@ COPY --from=build /go/src/app /app
EXPOSE 3000 EXPOSE 3000
USER guest USER guest
HEALTHCHECK --interval=30s --timeout=5s --start-period=15s --retries=3 CMD curl -fs http://localhost:3000/health
ENTRYPOINT ["/docker-entrypoint.sh"] ENTRYPOINT ["/docker-entrypoint.sh"]
HEALTHCHECK --interval=30s --timeout=5s --start-period=15s --retries=3 \
CMD curl -fs http://localhost:3000/health
CMD [ "/app/app" ]

View File

@ -4,7 +4,10 @@
# Immediately exit if any command has a non-zero exit status. # Immediately exit if any command has a non-zero exit status.
set -e set -e
# Execute any pre-startup scripts or tasks. # Execute DB migrations only when the main application is about to run
/app/app db:migrate up if [ "${1:-}" = "/app/app" ]; then
/app/app db:migrate up
fi
exec /app/app "$@" # Execute the main application
exec "$@"