From fcaaf1e46874891cef76477d7d3c3915a32ebcbb Mon Sep 17 00:00:00 2001 From: "Turpaud, Remi" Date: Fri, 17 Oct 2025 10:39:32 +0200 Subject: [PATCH] updated docker deploy example --- .../docker/deploy/caddy/Caddyfile | 1 + .../docker/docker-compose.yml | 2 +- examples/server-deployment/docker/env | 9 +++++ .../server-deployment/docker/site/index.html | 2 +- .../server-deployment/quickstart-docker.md | 33 ++++++++++--------- 5 files changed, 29 insertions(+), 18 deletions(-) create mode 100644 examples/server-deployment/docker/env diff --git a/examples/server-deployment/docker/deploy/caddy/Caddyfile b/examples/server-deployment/docker/deploy/caddy/Caddyfile index 4438936..72eb27b 100644 --- a/examples/server-deployment/docker/deploy/caddy/Caddyfile +++ b/examples/server-deployment/docker/deploy/caddy/Caddyfile @@ -46,6 +46,7 @@ } handle { root * /srv/site + templates file_server } } \ No newline at end of file diff --git a/examples/server-deployment/docker/docker-compose.yml b/examples/server-deployment/docker/docker-compose.yml index 201f845..9db9f78 100644 --- a/examples/server-deployment/docker/docker-compose.yml +++ b/examples/server-deployment/docker/docker-compose.yml @@ -42,7 +42,7 @@ services: mcp: condition: service_healthy environment: - # Set this to your DuckDNS (or real) domain, e.g. teradata-mcp.duckdns.org + # Set this to your (sub.)domain, e.g. mcp.teradata.org and ensure DNS points to this server - DOMAIN=${DOMAIN} ports: - "80:80" diff --git a/examples/server-deployment/docker/env b/examples/server-deployment/docker/env new file mode 100644 index 0000000..ae2ad45 --- /dev/null +++ b/examples/server-deployment/docker/env @@ -0,0 +1,9 @@ +# --- MCP server (FastMCP) --- +DATABASE_URI=teradata://USER:PASS@HOST:1025/DEFAULT_DB_SCHEMA # <-- Update here +MCP_TRANSPORT=streamable-http +MCP_HOST=0.0.0.0 +MCP_PORT=8001 + +# --- Caddy / HTTPS --- +# Set this to the DNS name that points at your server +DOMAIN=teradata-mcp.duckdns.org # <-- Update here \ No newline at end of file diff --git a/examples/server-deployment/docker/site/index.html b/examples/server-deployment/docker/site/index.html index df2b93d..9c92dfe 100644 --- a/examples/server-deployment/docker/site/index.html +++ b/examples/server-deployment/docker/site/index.html @@ -15,7 +15,7 @@ Teradata

Teradata MCP Server is running

-

Secure endpoint: /mcp/

+

Secure endpoint: https://{{.Host}}/mcp/

⚙️ Need to configure your client? See the diff --git a/examples/server-deployment/quickstart-docker.md b/examples/server-deployment/quickstart-docker.md index 505879a..aeef5e4 100644 --- a/examples/server-deployment/quickstart-docker.md +++ b/examples/server-deployment/quickstart-docker.md @@ -47,8 +47,12 @@ cd teradata-mcp-service ## 2) `.env` — runtime configuration -Update the `.env` file with your database connection string for `DATABASE_URI` and domain name for `DOMAIN`: - +Copy the `env` file to `.env` and edit it to update your database connection string for `DATABASE_URI` and domain name for `DOMAIN`: + +```bash +cp env .env +``` + ```dotenv # --- MCP server (FastMCP) --- DATABASE_URI=teradata://USER:PASS@HOST:1025/DEFAULT_DB_SCHEMA # <-- Update here @@ -65,13 +69,11 @@ DOMAIN=teradata-mcp.duckdns.org # <-- Update her --- -## 3) (Optional) landing page / favicon - -Add files under `examples/server-deployment/docker/site/` if you want a root page or custom icon: +## 3) (Optional) landing page -- Update `favicon.ico` and `favicon.png` with your preferred icon -- Update `index.html` (minimal example) - +You can update or add files under `examples/server-deployment/docker/site/` to customize the landing page. +The current setup indicates that the server is running and points the viewer to the client tool setup documentation. + --- ## 4) Start the stack @@ -79,7 +81,7 @@ Add files under `examples/server-deployment/docker/site/` if you want a root pag From your directory: ```bash -docker compose up -d --build +docker compose up -d --remove-orphans docker compose ps ``` @@ -91,7 +93,7 @@ docker compose logs -f caddy --- -## 7) Verify +## 5) Verify ```bash # Expect 200/401/405 from the app (not HTML) @@ -105,7 +107,7 @@ If you added a landing page: visit `https://${DOMAIN}/`. --- -## 8) Use with Claude Desktop +## 6) Use with Claude Desktop With HTTPS you **do not** need `--allow-http`: @@ -124,11 +126,11 @@ Add headers if you enforce auth at the app or proxy (e.g., `--header "Authorizat --- -## 9) Operations +## 7) Operations ```bash # Update/recreate -docker compose pull && docker compose up -d --build +docker compose pull && docker compose up -d --remove-orphans --build # Logs docker compose logs -f mcp @@ -143,11 +145,10 @@ docker compose down ## 10) Troubleshooting - **TLS errors right after deploy** → DNS propagation or first ACME run; retry in a minute and check `docker compose logs -f caddy`. -- **HTML/404 served at `/mcp/`** → ensure the `@mcp` matcher appears *before* the static handlers in `Caddyfile`. - **80/443 blocked** → open in Security Group / firewall; confirm public IPv4 resolves for `${DOMAIN}`. -- **Icon still shows DuckDNS duck** → Claude may brand by base domain (`duckdns.org`). Use your own domain to fully customize. --- -**That’s it.** You now have a clean, HTTPS-protected MCP server via Docker Compose with Caddy. +**That’s it.** You now have a HTTPS-protected MCP server via Docker Compose with Caddy. + -----