forked from IBM/mcp-context-forge
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-entrypoint.sh
More file actions
executable file
·37 lines (34 loc) · 1.48 KB
/
docker-entrypoint.sh
File metadata and controls
executable file
·37 lines (34 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env bash
#───────────────────────────────────────────────────────────────────────────────
# Script : docker-entrypoint.sh
# Purpose: Container entrypoint that allows switching between HTTP servers
#
# Environment Variables:
# HTTP_SERVER : Which HTTP server to use (default: gunicorn)
# - gunicorn : Python-based with Uvicorn workers (default)
# - granian : Rust-based HTTP server (alternative)
#
# Usage:
# # Run with Gunicorn (default)
# docker run -e HTTP_SERVER=gunicorn mcpgateway
#
# # Run with Granian
# docker run -e HTTP_SERVER=granian mcpgateway
#───────────────────────────────────────────────────────────────────────────────
set -euo pipefail
HTTP_SERVER="${HTTP_SERVER:-gunicorn}"
case "${HTTP_SERVER}" in
granian)
echo "Starting MCP Gateway with Granian (Rust-based HTTP server)..."
exec ./run-granian.sh "$@"
;;
gunicorn)
echo "Starting MCP Gateway with Gunicorn + Uvicorn..."
exec ./run-gunicorn.sh "$@"
;;
*)
echo "ERROR: Unknown HTTP_SERVER value: ${HTTP_SERVER}"
echo "Valid options: granian, gunicorn"
exit 1
;;
esac