From 9ac866ae4bd7a66bb53d40faf5de123d54a70856 Mon Sep 17 00:00:00 2001 From: nutshell9247 Date: Sat, 8 Aug 2026 07:33:28 +0000 Subject: [PATCH] Update Dockerfile --- Dockerfile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index ea7987a..84445c1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,6 +20,11 @@ FROM alpine:latest WORKDIR /app +# Receive PORT build arg from Coolify / Docker Compose (defaults to 8080 if unset) +ARG PORT=8080 +# Set PORT environment variable for runtime, HEALTHCHECK, and Go application +ENV PORT=${PORT} + # Install runtime dependencies RUN apk add --no-cache ca-certificates tzdata @@ -37,9 +42,9 @@ RUN addgroup -g 1000 appuser && \ USER appuser -EXPOSE 8080 +EXPOSE ${PORT} HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \ - CMD wget --quiet --tries=1 --spider http://localhost:8080/ || exit 1 + CMD wget --quiet --tries=1 --spider http://localhost:${PORT}/ || exit 1 CMD ["./blogging-cms"] \ No newline at end of file