|
|
|
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 scikit-learn==1.3.2 |
|
RUN pip install topic-wizard==1.1.0 |
|
RUN pip install joblib==1.2.0 |
|
RUN pip install turftopic==0.4.5 |
|
RUN pip install gensim==4.3.2 |
|
|
|
RUN useradd -m -u 1000 user |
|
|
|
|
|
USER user |
|
|
|
|
|
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 |
|
|
|
|
|
WORKDIR $HOME/app |
|
EXPOSE 7860 |
|
CMD gunicorn --timeout 0 -b 0.0.0.0:7860 --workers=2 --threads=4 --worker-class=gthread main:server |
|
|