Compare commits

...

2 Commits

Author SHA1 Message Date
08856f9a8d feat: install curl in docker to perform health check 2025-12-25 18:34:57 +01:00
2522f3536d feat: create health check 2025-12-25 18:34:39 +01:00
2 changed files with 6 additions and 1 deletions

View File

@@ -13,7 +13,7 @@ RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -ldflags="-s -w
# building the application image # building the application image
FROM alpine:3.23 FROM alpine:3.23
RUN addgroup -S goyco && adduser -S -G goyco goyco \ RUN addgroup -S goyco && adduser -S -G goyco goyco \
&& apk add --no-cache ca-certificates tzdata && apk add --no-cache ca-certificates curl tzdata
WORKDIR /app WORKDIR /app
COPY --from=go-builder /out/goyco ./goyco COPY --from=go-builder /out/goyco ./goyco
COPY --from=go-builder /src/internal/static ./internal/static COPY --from=go-builder /src/internal/static ./internal/static

View File

@@ -25,6 +25,11 @@ services:
APP_BASE_URL: ${APP_BASE_URL:-http://127.0.0.1:8080} APP_BASE_URL: ${APP_BASE_URL:-http://127.0.0.1:8080}
ports: ports:
- "8080:8080" - "8080:8080"
healthcheck:
test: ["CMD-SHELL", "curl -fsS http://localhost:${SERVER_PORT:-8080}/health | grep -q '\"status\":\"healthy\"'"]
interval: 10s
timeout: 5s
retries: 5
restart: always restart: always
networks: networks:
- goyco - goyco