fix: add /health endpoint before auth middleware for Docker healthcheck (was 401 with MCP_REQUIRE_AUTH=true)
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 16s

This commit is contained in:
Antigravity
2026-05-03 19:45:27 +00:00
parent 1ed7839334
commit 0311c97a35
2 changed files with 6 additions and 2 deletions

View File

@@ -99,7 +99,7 @@ services:
cpus: '0.25'
memory: 128M
healthcheck:
test: ["CMD-SHELL", "wget --spider -q http://localhost:3001/ || exit 1"]
test: ["CMD-SHELL", "wget -q -O /dev/null http://localhost:3001/health || exit 1"]
interval: 30s
timeout: 10s
retries: 3

View File

@@ -92,6 +92,10 @@ const app = express();
app.use(cors());
app.use(express.json({ limit: '10mb' }));
// ── Health (before auth middleware — used by Docker healthcheck) ────────────
app.get('/health', (req, res) => res.json({ ok: true, uptime: process.uptime() }));
// ── Auth Middleware ──────────────────────────────────────────────────────────
app.use(async (req, res, next) => {
@@ -211,7 +215,7 @@ app.get('/', (req, res) => {
name: 'Memento MCP Server',
version: '3.2.0',
status: 'running',
endpoints: { mcp: '/mcp', health: '/', sessions: '/sessions' },
endpoints: { mcp: '/mcp', health: '/health', sessions: '/sessions' },
auth: { enabled: process.env.MCP_REQUIRE_AUTH === 'true' },
tools: 22,
});