Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from bundle
Telegram MTProto MCP server with userbot watcher, chat/DM parser and context builders
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
Dockerfile
1# Use an official Python runtime as a parent image (Alpine-based for minimal vulnerabilities)2FROM python:3.13-alpine34# Set the working directory in the container5WORKDIR /app67# Prevent Python from writing pyc files to disc8ENV PYTHONDONTWRITEBYTECODE=19# Ensure Python output is sent straight to terminal (useful for logs)10ENV PYTHONUNBUFFERED=11112# Install system dependencies if needed (e.g., for certain Python packages)13# RUN apt-get update && apt-get install -y --no-install-recommends some-package && rm -rf /var/lib/apt/lists/*1415# Copy dependency definition files16# If using Poetry:17# COPY pyproject.toml poetry.lock* ./18# RUN pip install --no-cache-dir poetry19# RUN poetry config virtualenvs.create false && poetry install --no-dev --no-interaction --no-ansi20# If using pip with requirements.txt:21COPY requirements.txt ./22RUN pip install --no-cache-dir --upgrade pip23RUN pip install --no-cache-dir -r requirements.txt2425# Copy the rest of the application code26COPY main.py .27# COPY session_string_generator.py . # Optional: if needed within the container, otherwise can be run outside2829# Create a non-root user and switch to it30RUN adduser --disabled-password --gecos "" appuser && chown -R appuser:appuser /app31USER appuser3233# Define environment variables needed by the application34# These should be provided at runtime, not hardcoded (especially secrets)35ENV TELEGRAM_API_ID=""36ENV TELEGRAM_API_HASH=""37# Specify one of the following at runtime:38# Default session filename39ENV TELEGRAM_SESSION_NAME="telegram_mcp_session"40# Or provide the session string directly41ENV TELEGRAM_SESSION_STRING=""4243# Expose any ports if the application were a web server (not needed for stdio MCP)44# EXPOSE 80004546# Define the command to run the application47CMD ["python", "main.py"]