| |
| |
|
|
| FROM python:3.9-slim-bookworm |
|
|
| |
| ENV PYTHONUNBUFFERED=1 \ |
| PYTHONDONTWRITEBYTECODE=1 \ |
| PIP_NO_CACHE_DIR=1 \ |
| DEBIAN_FRONTEND=noninteractive \ |
| PYTHONPATH=/code |
|
|
| |
| RUN apt-get update && apt-get install -y \ |
| |
| build-essential \ |
| python3-dev \ |
| libgl1 \ |
| libglib2.0-0 \ |
| libsm6 \ |
| libxext6 \ |
| libxrender-dev \ |
| libgomp1 \ |
| |
| libnss3 \ |
| libnspr4 \ |
| libdbus-1-3 \ |
| libatk1.0-0 \ |
| libatk-bridge2.0-0 \ |
| libcups2 \ |
| libdrm2 \ |
| libxkbcommon0 \ |
| libxcomposite1 \ |
| libxdamage1 \ |
| libxfixes3 \ |
| libxrandr2 \ |
| libgbm1 \ |
| libpango-1.0-0 \ |
| libcairo2 \ |
| libasound2 \ |
| |
| wget \ |
| curl \ |
| git \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| |
| WORKDIR /code |
|
|
| |
| COPY requirements.txt /code/requirements.txt |
|
|
| |
| RUN pip install --no-cache-dir --upgrade pip && \ |
| pip install --no-cache-dir -r requirements.txt |
|
|
| |
| RUN playwright install chromium |
|
|
| |
| RUN mkdir -p /code/logs /code/models /tmp |
|
|
| |
| COPY . /code/ |
|
|
| |
| EXPOSE 7860 |
|
|
| |
| ENV GRADIO_SERVER_NAME="0.0.0.0" \ |
| GRADIO_SERVER_PORT=7860 \ |
| PYTHONPATH=/code |
|
|
| |
| HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ |
| CMD curl -f http://localhost:7860/health || exit 1 |
|
|
| |
| CMD ["python", "start.py"] |
| |