FROM python:3.11-slim WORKDIR /app # Keeps logs instant and prevents Docker from writing unnecessary .pyc files ENV DEBIAN_FRONTEND=noninteractive \ PYTHONDONTWRITEBYTECODE=1 \ PYTHONUNBUFFERED=1 # Installs timezone data and build toolchain for C-extensions (tgcrypto on ARM64/AMD64) RUN apt-get update && \ apt-get install -y --no-install-recommends tzdata build-essential gcc python3-dev && \ ln -fs /usr/share/zoneinfo/UTC /etc/localtime && \ dpkg-reconfigure -f noninteractive tzdata && \ rm -rf /var/lib/apt/lists/* COPY requirements.txt . # Upgrades pip and installs everything using pre-compiled binaries for maximum speed RUN pip install --upgrade pip && \ pip install --no-cache-dir --prefer-binary -r requirements.txt COPY . . # Boots the app CMD ["python", "app.py"]