From 4a01b9094b82b6ec3b7cfdd24feeecd6a1c4148d Mon Sep 17 00:00:00 2001 From: "borja (aider)" Date: Thu, 27 Mar 2025 17:48:36 +0100 Subject: [PATCH] feat: Add healthcheck and dynamic port support in Dockerfile --- Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index b65f8cb..beedba3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,11 +11,11 @@ COPY src/ ./src/ COPY index.ts ./ # Health check -# HEALTHCHECK --interval=30s --timeout=3s \ -# CMD curl -f http://localhost:3007/health || exit 1 +HEALTHCHECK --interval=30s --timeout=3s \ + CMD curl -f http://localhost:${PORT:-3007}/health || exit 1 -# Server runs on port 3007 by default -EXPOSE 3007 +# Server runs on port from environment variable +EXPOSE ${PORT:-3007} # Start the server CMD ["bun", "run", "index.ts"]