Skip to content

Commit 8bb3049

Browse files
committed
fix: fix docker build
1 parent 86b5466 commit 8bb3049

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
@@ -316,14 +317,14 @@ def _init_chdb_client():
316317

317318

318319
# Register tools based on configuration
319-
if get_config().enabled:
320+
if os.getenv("CLICKHOUSE_ENABLED", "true").lower() == "true":
320321
mcp.add_tool(list_databases)
321322
mcp.add_tool(list_tables)
322323
mcp.add_tool(run_select_query)
323324
logger.info("ClickHouse tools registered")
324325

325326

326-
if get_chdb_config().enabled:
327+
if os.getenv("CHDB_ENABLED", "false").lower() == "true":
327328
_chdb_client = _init_chdb_client()
328329
if _chdb_client:
329330
atexit.register(lambda: _chdb_client.close())

0 commit comments

Comments
 (0)