forked from microsoft/presidio
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile.python.deps
32 lines (24 loc) · 1.11 KB
/
Dockerfile.python.deps
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
FROM python:3.7-slim
ARG re2_version="2018-12-01"
ARG NAME=presidio-analyzer
ENV PIP_NO_CACHE_DIR true
COPY ./${NAME}/Pipfile /usr/bin/${NAME}/Pipfile
COPY ./${NAME}/Pipfile.lock /usr/bin/${NAME}/Pipfile.lock
WORKDIR /usr/bin/${NAME}
RUN apt-get update -qq \
&& DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends \
wget build-essential && \
wget -O re2.tar.gz https://github.com/google/re2/archive/${re2_version}.tar.gz && \
mkdir re2 && tar --extract --file "re2.tar.gz" --directory "re2" --strip-components 1 && \
cd re2 && make install && cd .. && rm -rf re2 && rm re2.tar.gz && \
apt-get clean autoclean && apt-get autoremove --yes && rm -rf /var/lib/{apt,dpkg,cache,log}/
# Making sure we have pipenv
RUN pip install pipenv
# Updating setuptools
RUN pip install --upgrade setuptools
# Installing specified packages from Pipfile.lock
RUN bash -c 'PIPENV_VENV_IN_PROJECT=1 pipenv sync'
# Install for tests, consider making this optional
RUN pipenv run python -m spacy download en_core_web_lg
# Print to screen the installed packages for easy debugging
RUN pipenv run pip freeze