File size: 792 Bytes
da85ec8
c07144a
 
 
 
 
 
 
 
 
 
 
 
 
13573ac
 
 
 
 
 
c07144a
 
 
 
 
 
 
 
 
 
5dd54ad
c07144a
 
 
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
FROM intelligencenoborders/scinobo-fos-classification:latest

# Copy files
COPY download_model.py /app

RUN useradd -m -u 1000 user
RUN chown -R user /app
USER user
ENV HOME=/home/user \
	PATH=/home/user/.local/bin:$PATH

# Run the download
RUN python /app/download_model.py

# download spacy model
RUN python3 -m spacy download en_core_web_sm

# download nltk punkt and stopwords
RUN python3 -c "import nltk; nltk.download('punkt'); nltk.download('stopwords')"

# Set the working directory in the container
WORKDIR /app/src

# Expose the port that Gradio will run on
EXPOSE 7860

ENV PYTHONUNBUFFERED=1 \
	GRADIO_ALLOW_FLAGGING=never \
	GRADIO_NUM_PORTS=1 \
	GRADIO_SERVER_NAME=0.0.0.0 \
	SYSTEM=spaces 

# Run app.py when the container launches
CMD ["python", "-m", "fos.server.gradio_app"]