File size: 1,176 Bytes
1728ec4
 
 
 
2fd7df7
 
1728ec4
2fd7df7
 
1728ec4
aee1976
fe399cf
0ee36dc
0bc101b
fe399cf
 
0bc101b
ab73e57
 
b420ca4
fe399cf
 
 
ab73e57
0ee36dc
f6b820a
0ee36dc
 
f6b820a
0ee36dc
 
f6b820a
aee1976
1728ec4
 
 
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.10

WORKDIR /code

COPY ./requirements.txt /code/requirements.txt
# COPY ./new_requirements.txt /code/new_requirements.txt

RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
# RUN pip install --no-cache-dir --upgrade -r /code/new_requirements.txt

# Install spaCy model
# RUN python -m spacy download en_core_web_sm

# Patch SpaCy to use Pydantic v1 in case v2 is installed
# RUN sed -i 's/from pydantic import ConstrainedStr/from pydantic.v1 import ConstrainedStr/' \
#     /usr/local/lib/python3.10/site-packages/spacy/schemas.py


# Install Pydantic v1 and SpaCy explicitly to prevent version conflicts
# RUN pip install pydantic==1.10.12 spacy==3.5.3
# RUN pip install pydantic==1.10.12

RUN pip install stanza==1.9.2

# Copy the local en_core_web_sm-3.0.0.tar.gz file into the container
# COPY ./en_core_web_sm-3.0.0.tar.gz /models/en_core_web_sm-3.0.0.tar.gz

# Install the spaCy model from the .tar.gz file
# RUN pip install /models/en_core_web_sm-3.0.0.tar.gz

# Clean up the .tar.gz file after installation
# RUN rm /models/en_core_web_sm-3.0.0.tar.gz

COPY . . 

CMD ["waitress-serve", "--host", "0.0.0.0", "--port", "7860", "app:app"]