Update Dockerfile
This commit is contained in:
+7
-2
@@ -20,6 +20,11 @@ FROM alpine:latest
|
|||||||
|
|
||||||
WORKDIR /app
|
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
|
# Install runtime dependencies
|
||||||
RUN apk add --no-cache ca-certificates tzdata
|
RUN apk add --no-cache ca-certificates tzdata
|
||||||
|
|
||||||
@@ -37,9 +42,9 @@ RUN addgroup -g 1000 appuser && \
|
|||||||
|
|
||||||
USER appuser
|
USER appuser
|
||||||
|
|
||||||
EXPOSE 8080
|
EXPOSE ${PORT}
|
||||||
|
|
||||||
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
|
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"]
|
CMD ["./blogging-cms"]
|
||||||
Reference in New Issue
Block a user