FROM python:3.11-slim-bullseye RUN apt update RUN apt install -y build-essential RUN pip install gunicorn==20.1.0 RUN pip install typing-extensions RUN pip install topic-wizard==1.1.4 turftopic==0.17.1 plotly==5.18.0 sentence-transformers==3.3.1 scikit-learn==1.3.2 joblib==1.2.0 gensim==4.3.2 transformers==4.48.0 RUN useradd -m -u 1000 user # Switch to the "user" user USER user # Set home to the user's home directory ENV HOME=/home/user \ PATH=/home/user/.local/bin:$PATH COPY --chown=user . $HOME/app RUN mkdir /home/user/numba_cache RUN chmod 777 /home/user/numba_cache ENV NUMBA_CACHE_DIR=/home/user/numba_cache # Set the working directory to the user's home directory WORKDIR $HOME/app EXPOSE 7860 CMD python main.py