| |
| FROM python:3.9-slim |
|
|
| |
| RUN apt-get update && apt-get install -y \ |
| build-essential \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| |
| RUN mkdir -p /tmp/huggingface && \ |
| chmod -R 777 /tmp/huggingface |
|
|
| |
| RUN useradd -m -s /bin/bash user && \ |
| chown -R user:user /tmp/huggingface |
|
|
| USER user |
| ENV HOME=/home/user \ |
| PATH=/home/user/.local/bin:$PATH |
|
|
| |
| WORKDIR $HOME/app |
|
|
| |
| RUN mkdir -p $HOME/app/session_data $HOME/app/session_summaries $HOME/app/vector_db $HOME/app/models |
|
|
| |
| COPY --chown=user:user requirements.txt . |
| RUN pip install --user --no-cache-dir -r requirements.txt |
|
|
| |
| COPY --chown=user:user . . |
|
|
| |
| RUN chmod +x start.sh |
|
|
| |
| ENV PORT=7860 |
| ENV TRANSFORMERS_CACHE=/tmp/huggingface |
| ENV HF_HOME=/tmp/huggingface |
| ENV TOKENIZERS_PARALLELISM=false |
| ENV TRANSFORMERS_VERBOSITY=error |
| ENV BITSANDBYTES_NOWELCOME=1 |
|
|
| |
| EXPOSE 7860 |
|
|
| |
| CMD ["./start.sh"] |
|
|