File size: 1,605 Bytes
d03a152
 
2d6afaa
35244e6
 
 
 
2d6afaa
 
d03a152
35244e6
 
 
 
 
2d6afaa
 
d03a152
05b4a25
d03a152
 
 
 
 
 
35244e6
 
 
d03a152
 
 
 
2d6afaa
d03a152
2d6afaa
 
d03a152
2471025
 
 
 
d03a152
2471025
71eeb8d
2909a76
2d6afaa
d03a152
2d6afaa
 
 
78399e3
 
 
2d6afaa
 
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# Pin to Debian 12 so wkhtmltox bookworm package exists
FROM python:3.10-bookworm

ENV DEBIAN_FRONTEND=noninteractive \
    PYTHONDONTWRITEBYTECODE=1 \
    PYTHONUNBUFFERED=1

WORKDIR /app

# OS deps + fonts + X libs required by wkhtmltopdf
RUN apt-get update && apt-get install -y --no-install-recommends \
    ca-certificates curl gnupg git xz-utils \
    fontconfig fonts-dejavu-core \
    libfreetype6 libjpeg62-turbo libpng16-16 \
    libx11-6 libxext6 libxrender1 libxcb1 \
    && rm -rf /var/lib/apt/lists/*

# Install wkhtmltopdf (bookworm build)
ARG WKHTML_VER=0.12.6.1-3
RUN curl -fsSL -o /tmp/wkhtml.deb \
    "https://github.com/wkhtmltopdf/packaging/releases/download/${WKHTML_VER}/wkhtmltox_${WKHTML_VER}.bookworm_amd64.deb" \
 && apt-get update \
 && apt-get install -y --no-install-recommends /tmp/wkhtml.deb \
 && rm -f /tmp/wkhtml.deb \
 && rm -rf /var/lib/apt/lists/*

RUN wkhtmltopdf --version

# Node.js LTS (for repomix)
RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - \
 && apt-get update && apt-get install -y --no-install-recommends nodejs \
 && rm -rf /var/lib/apt/lists/*

# repomix
RUN npm install -g repomix

# Poetry
RUN curl -sSL https://install.python-poetry.org | python3 -
ENV PATH="/root/.local/bin:$PATH"
RUN poetry config virtualenvs.create false

# deps first for better layer caching
COPY poetry.lock pyproject.toml /app/
RUN poetry install --no-root --no-interaction --no-ansi
RUN pip install gradio[mcp]

# app
COPY . .

EXPOSE 7860
ENV GRADIO_SERVER_NAME=0.0.0.0 \
    GRADIO_SERVER_PORT=7860 \
    GRADIO_MCP_SERVER=True

CMD ["python", "app.py"]