-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
40 lines (31 loc) · 1.21 KB
/
Dockerfile
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
37
38
39
40
FROM python:3.8-slim
RUN apt-get update \
&& apt-get install --assume-yes --quiet --quiet \
gcc g++ \
&& rm -rf /var/lib/apt/lists/*
COPY requirements.build.txt ./
RUN pip install --disable-pip-version-check \
-r requirements.build.txt
# install spaCy separately to allow better caching of large language model download
COPY requirements.spacy.txt ./
RUN pip install --disable-pip-version-check -r requirements.spacy.txt
# download spaCy language models
RUN python -m spacy download en_core_web_lg
COPY requirements.txt ./
RUN pip install --disable-pip-version-check \
-r requirements.spacy.txt \
-r requirements.txt
COPY requirements.dev.txt ./
ARG install_dev=n
RUN if [ "${install_dev}" = "y" ]; then \
pip install --disable-pip-version-check --user \
-r requirements.spacy.txt \
-r requirements.txt \
-r requirements.dev.txt; \
fi
COPY spacy_keyword_extraction_api ./spacy_keyword_extraction_api
COPY static ./static
COPY config ./config
COPY tests ./tests
COPY .flake8 .pylintrc pyproject.toml ./
CMD ["python3", "-m", "uvicorn", "spacy_keyword_extraction_api.main:create_app", "--factory", "--host", "0.0.0.0", "--port", "8000", "--log-config=config/logging.yaml"]