Skip to content

Commit 287a49a

Browse files
committed
Add Docker healthcheck with migration-friendly timings
Add HEALTHCHECK instruction to monitor Gitea service health using the /api/healthz endpoint. Configured with: - interval: 2m (check every 2 minutes, Gitea isn't that sensitive) - start-period: 2m (allows time for migrations during upgrades) - timeout: 10s - retries: 3 This helps container orchestrators detect and restart unhealthy instances while avoiding restarts during normal startup or database migrations.
1 parent c22204e commit 287a49a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ LABEL maintainer="[email protected]"
4646

4747
EXPOSE 22 3000
4848

49-
HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \
49+
HEALTHCHECK --interval=2m --timeout=10s --start-period=2m --retries=3 \
5050
CMD curl -f http://localhost:3000/api/healthz || exit 1
5151

5252
RUN apk --no-cache add \

Dockerfile.rootless

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ LABEL maintainer="[email protected]"
4444

4545
EXPOSE 2222 3000
4646

47-
HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \
47+
HEALTHCHECK --interval=2m --timeout=10s --start-period=2m --retries=3 \
4848
CMD curl -f http://localhost:3000/api/healthz || exit 1
4949

5050
RUN apk --no-cache add \

0 commit comments

Comments
 (0)