File size: 816 Bytes
81bad0b
4fefa96
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36

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

# 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 gunicorn --timeout 0 -b 0.0.0.0:7860 --workers=2 --threads=4 --worker-class=gthread main:server