| |
| |
|
|
| FROM python:3.11-slim |
|
|
| |
| RUN apt-get update && apt-get install -y --no-install-recommends \ |
| build-essential \ |
| git \ |
| curl \ |
| libgl1 \ |
| libglib2.0-0 \ |
| poppler-utils \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| WORKDIR /app |
|
|
| |
| RUN useradd -m -u 1000 user |
| ENV HOME=/home/user \ |
| PATH=/home/user/.local/bin:$PATH \ |
| PYTHONUNBUFFERED=1 \ |
| PYTHONDONTWRITEBYTECODE=1 \ |
| HF_HOME=/home/user/.cache/huggingface \ |
| GRADIO_SERVER_NAME=0.0.0.0 \ |
| GRADIO_SERVER_PORT=7860 |
|
|
| |
| COPY --chown=user:user requirements.txt /app/requirements.txt |
| USER user |
| RUN pip install --no-cache-dir --user --upgrade pip && \ |
| pip install --no-cache-dir --user -r /app/requirements.txt |
|
|
| |
| COPY --chown=user:user . /app |
|
|
| |
| |
| USER root |
| RUN mkdir -p /app/logs /home/user/.cache/huggingface && \ |
| chown -R user:user /app /home/user/.cache |
| USER user |
| ENV BANKMIND_LOG_DIR=/app/logs |
|
|
| EXPOSE 7860 |
|
|
| |
| CMD ["python", "app.py"] |
|
|