| |
| |
| |
| |
| FROM python:3.11-slim |
|
|
| ENV DEBIAN_FRONTEND=noninteractive \ |
| PYTHONUNBUFFERED=1 \ |
| HOME=/home/user \ |
| XDG_CACHE_HOME=/tmp/cache \ |
| MPLCONFIGDIR=/tmp/cache/mpl \ |
| FONTCONFIG_PATH=/etc/fonts \ |
| PLAYWRIGHT_BROWSERS_PATH=/opt/pw-browsers \ |
| GRADIO_SERVER_NAME=0.0.0.0 \ |
| GRADIO_SERVER_PORT=7860 \ |
| HOME=/home/user |
|
|
| RUN apt-get update && apt-get install -y --no-install-recommends \ |
| ffmpeg curl ca-certificates gnupg \ |
| && curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \ |
| && apt-get install -y --no-install-recommends nodejs \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| WORKDIR /app |
|
|
| COPY requirements.txt ./ |
| RUN pip install --no-cache-dir -r requirements.txt |
|
|
| |
| |
| COPY derisk/package.json ./derisk/package.json |
| RUN cd derisk && npm install --omit=dev --no-audit --no-fund \ |
| && npx playwright install --with-deps chromium \ |
| && chmod -R a+rX /opt/pw-browsers |
|
|
| |
| |
| RUN mkdir -p /tmp/cache/mpl && chmod -R 777 /tmp/cache |
| RUN useradd -m -u 1000 user |
| COPY --chown=user:user . /app |
| RUN chown -R user:user /app |
| USER user |
|
|
| EXPOSE 7860 |
| |
| |
| |
| CMD ["python", "loader.py"] |
|
|