forked from HazyResearch/fonduer
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
34 lines (29 loc) · 1.12 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
FROM python:3.7-slim
LABEL maintainer="Hiromu Hota <[email protected]>"
# https://github.com/debuerreotype/debuerreotype/issues/10
RUN seq 1 8 | xargs -I{} mkdir -p /usr/share/man/man{}
# Install deb packages
RUN apt-get update && apt-get install -y --no-install-recommends \
poppler-utils \
postgresql-client \
libmagickwand-dev \
libpq-dev \
build-essential \
&& rm /etc/ImageMagick-6/policy.xml \
&& rm -rf /var/lib/{apt,dpkg,cache,log}/
# Create a user and its virtual environment
RUN groupadd user && useradd -r -m -g user user
USER user
WORKDIR /home/user
ENV VIRTUAL_ENV=/home/user/.venv
RUN python -m venv $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
# Set --build-arg FONDUER_VERSION=X.X.X to install a specific version of
# Fonduer, otherwise the lastest version is installed.
ARG FONDUER_VERSION=
# Install python packages
RUN pip install \
torch==1.4.0+cpu -f https://download.pytorch.org/whl/torch_stable.html \
# https://github.com/HazyResearch/fonduer/issues/390
"tensorboard<2.0.0,>=1.14.0" "scikit-learn<0.22.0,>=0.20.2" \
fonduer${FONDUER_VERSION:+==${FONDUER_VERSION}}