Skip to content

Commit fdc5fba

Browse files
committed
fix: fix docker build
1 parent 9153425 commit fdc5fba

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build stage - Use a Python image with uv pre-installed
2-
FROM ghcr.io/astral-sh/uv:python3.13-alpine AS builder
2+
FROM ghcr.io/astral-sh/uv:python3.13-bookworm AS builder
33

44
# Install the project into `/app`
55
WORKDIR /app
@@ -11,8 +11,8 @@ ENV UV_COMPILE_BYTECODE=1
1111
ENV UV_LINK_MODE=copy
1212

1313
# Install git and build dependencies for ClickHouse client
14-
RUN --mount=type=cache,target=/var/cache/apk \
15-
apk add git build-base
14+
RUN --mount=type=cache,target=/var/cache/apt \
15+
apt-get update && apt-get install -y git build-essential
1616

1717
# Install the project's dependencies using the lockfile and settings
1818
RUN --mount=type=cache,target=/root/.cache/uv \
@@ -28,7 +28,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \
2828
uv sync --locked --no-dev --no-editable
2929

3030
# Production stage - Use minimal Python image
31-
FROM python:3.13-alpine
31+
FROM python:3.13-bookworm
3232

3333
# Set the working directory
3434
WORKDIR /app

mcp_clickhouse/mcp_server.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from typing import Optional, List, Any
44
import concurrent.futures
55
import atexit
6+
import os
67

78
import clickhouse_connect
89
import chdb.session as chs
@@ -319,14 +320,14 @@ def _init_chdb_client():
319320

320321

321322
# Register tools based on configuration
322-
if get_config().enabled:
323+
if os.getenv("CLICKHOUSE_ENABLED", "true").lower() == "true":
323324
mcp.add_tool(list_databases)
324325
mcp.add_tool(list_tables)
325326
mcp.add_tool(run_select_query)
326327
logger.info("ClickHouse tools registered")
327328

328329

329-
if get_chdb_config().enabled:
330+
if os.getenv("CHDB_ENABLED", "false").lower() == "true":
330331
_chdb_client = _init_chdb_client()
331332
if _chdb_client:
332333
atexit.register(lambda: _chdb_client.close())

0 commit comments

Comments
 (0)