Fix review findings F1-F3 for Docker context, health check and version
Independent review Approved — 0 high findings (#5)

F1: exclude generated internal/frontend/dist from the Docker build context.
F2: derive the health check host from MEALQUEST_HTTP_ADDR, mapping wildcard
hosts and localhost to 127.0.0.1 and keeping IPv6 brackets.
F3: compute the -dirty suffix ignoring the generated embed output, so a
rebuild of a clean checkout is not stamped dirty.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-02 23:02:31 -04:00
co-authored by Claude Opus 5.5
parent 2e5724d150
commit 9b66ba0ff5
3 changed files with 12 additions and 4 deletions
+6 -3
View File
@@ -32,8 +32,11 @@ ENV MEALQUEST_HTTP_ADDR=:8080 \
VOLUME /data
EXPOSE 8080
USER 10001:10001
# Probe the port from MEALQUEST_HTTP_ADDR (text after the last colon) so an
# overridden listen address stays healthy.
# Probe the listener from MEALQUEST_HTTP_ADDR: host is everything before the
# last colon (IPv6 keeps its brackets). Wildcard hosts map to loopback, as
# does localhost: Go listens on its IPv4 address but wget would try ::1.
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD wget -q -O /dev/null "http://127.0.0.1:${MEALQUEST_HTTP_ADDR##*:}/health" || exit 1
CMD host="${MEALQUEST_HTTP_ADDR%:*}"; \
case "$host" in ""|0.0.0.0|"[::]"|localhost) host=127.0.0.1 ;; esac; \
wget -q -O /dev/null "http://${host}:${MEALQUEST_HTTP_ADDR##*:}/health" || exit 1
ENTRYPOINT ["/usr/local/bin/mealquest"]