Spaces:
Sleeping
Sleeping
FROM python:3.11-slim-bullseye | |
RUN apt update | |
RUN apt install -y build-essential | |
RUN apt install -y git | |
RUN pip install "gunicorn==20.1.0" | |
RUN pip install typing-extensions | |
RUN pip install "scikit-learn==1.3.2" | |
RUN pip install "turftopic[topic-wizard, opentsne]" | |
RUN pip install openTSNE | |
RUN pip install plotly==5.18.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 | |
RUN git clone https://github.com/x-tabdeveloping/topicwizard | |
WORKDIR $HOME/app/topicwizard | |
RUN git checkout topic-arena | |
RUN cp $HOME/app/main.py $HOME/app/topicwizard/main.py | |
RUN cp $HOME/app/keynmf_data.joblib $HOME/app/topicwizard/keynmf_data.joblib | |
RUN cp $HOME/app/top2vec_data.joblib $HOME/app/topicwizard/top2vec_data.joblib | |
EXPOSE 7860 | |
CMD gunicorn --timeout 0 -b 0.0.0.0:7860 --workers=2 --threads=4 --worker-class=gthread main:server | |