| FROM python:3.11-slim |
|
|
| |
| RUN apt-get update && apt-get install -y curl ca-certificates tar gzip ffmpeg \ |
| && curl -LsSf https://astral.sh/uv/install.sh | sh \ |
| && apt-get clean \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| ENV PATH="/root/.local/bin:$PATH" |
|
|
| |
| ENV LIGHTPANDA_BINARY="/usr/local/bin/lightpanda" |
| ENV LIGHTPANDA_AUTOSTART="true" |
| ENV LIGHTPANDA_PORT="9222" |
|
|
| |
| ENV HF_HOME="/app/data/huggingface" |
| ENV HF_HUB_CACHE="/app/data/huggingface/cache" |
| ENV HF_HUB_ENABLE_HF_TRANSFER="1" |
| |
| ENV CUDA_VISIBLE_DEVICES="" |
|
|
| WORKDIR /app |
|
|
| |
| COPY pyproject.toml uv.lock ./ |
| RUN uv sync --frozen --no-dev |
|
|
| |
| |
| |
| RUN curl -fL -o /usr/local/bin/lightpanda \ |
| https://github.com/lightpanda-io/browser/releases/download/nightly/lightpanda-x86_64-linux \ |
| && chmod +x /usr/local/bin/lightpanda \ |
| && /usr/local/bin/lightpanda version || echo "lightpanda installed (version probe failed)" |
|
|
| |
| COPY dist/frontend/ ./dist/frontend/ |
|
|
| |
| COPY app/ ./app |
| COPY plugins/ ./plugins |
|
|
| |
| RUN find /app -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true \ |
| && find /app -name "*.pyc" -delete 2>/dev/null || true |
|
|
| EXPOSE 7860 |
| CMD ["uv", "run", "uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860", "--proxy-headers", "--forwarded-allow-ips", "*"] |
|
|