diff --git a/Dockerfile b/Dockerfile index 2f30853..c02edd3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -28,3 +28,6 @@ COPY --from=builder /app/target/x86_64-unknown-linux-musl/release/world-id-teleg USER 100 EXPOSE 8000 CMD ["/app/world-id-telegram"] + +HEALTHCHECK --interval=5m --timeout=3s \ + CMD curl -f http://localhost:8000/health || exit 1 diff --git a/src/server/mod.rs b/src/server/mod.rs index fdfc6b1..9f18486 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -27,6 +27,7 @@ pub async fn start(bot: Bot, config: AppConfig, bot_data: User, join_requests: J Redirect::permanent(&format!("https://t.me/{}", bot_data.username.unwrap())) }), ) + .route("/health", get(|| async { "OK" })) .route( "/verify/:chat_id/:user_id", get(verify_page).post(verify_api),