diff --git a/Dockerfile b/Dockerfile index 78a556497a6c0..a380f5c80763f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -46,6 +46,9 @@ LABEL maintainer="maintainers@gitea.io" EXPOSE 22 3000 +HEALTHCHECK --interval=2m --timeout=10s --start-period=2m --retries=3 \ + CMD curl -f http://localhost:3000/api/healthz || exit 1 + RUN apk --no-cache add \ bash \ ca-certificates \ diff --git a/Dockerfile.rootless b/Dockerfile.rootless index e83c1af33b90d..59a5529b61819 100644 --- a/Dockerfile.rootless +++ b/Dockerfile.rootless @@ -44,6 +44,9 @@ LABEL maintainer="maintainers@gitea.io" EXPOSE 2222 3000 +HEALTHCHECK --interval=2m --timeout=10s --start-period=2m --retries=3 \ + CMD curl -f http://localhost:3000/api/healthz || exit 1 + RUN apk --no-cache add \ bash \ ca-certificates \