Skip to content

Commit 4c192e3

Browse files
authored
Merge pull request #488 from HytaleModding/fix/downtime-between-deployments
fix: add health check to get rid of the downtime between deployments
2 parents 6ad256b + ac59dfc commit 4c192e3

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,7 @@ EXPOSE 8080
3232
ENV NODE_ENV=production
3333
ENV PORT=8080
3434
ENV HOSTNAME="0.0.0.0"
35-
CMD ["bun", "run", "start"]
35+
CMD ["bun", "run", "start"]
36+
37+
HEALTHCHECK --interval=5s --timeout=5s --start-period=45s --retries=3 \
38+
CMD wget --no-verbose --tries=1 --spider http://localhost:8080/api/health || exit 1

src/app/api/health/route.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export function GET() {
2+
return new Response("OK", { status: 200 });
3+
}

0 commit comments

Comments
 (0)