-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
53 lines (50 loc) · 1.75 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
41
42
43
44
45
46
47
48
49
50
51
52
53
FROM frolvlad/alpine-glibc:alpine-3.12
ARG CONDA_VERSION="4.7.12.1"
ARG CONDA_MD5="81c773ff87af5cfac79ab862942ab6b3"
ARG CONDA_DIR="/opt/conda"
ENV PATH="$CONDA_DIR/bin:$PATH"
ENV PYTHONDONTWRITEBYTECODE=1
# Install conda
RUN echo "**** install dev packages ****" && \
apk add --no-cache --virtual .build-dependencies bash ca-certificates wget && \
\
echo "**** get Miniconda ****" && \
mkdir -p "$CONDA_DIR" && \
wget "http://repo.continuum.io/miniconda/Miniconda3-${CONDA_VERSION}-Linux-x86_64.sh" -O miniconda.sh && \
echo "$CONDA_MD5 miniconda.sh" | md5sum -c && \
\
echo "**** install Miniconda ****" && \
bash miniconda.sh -f -b -p "$CONDA_DIR" && \
echo "export PATH=$CONDA_DIR/bin:\$PATH" > /etc/profile.d/conda.sh && \
\
echo "**** setup Miniconda ****" && \
conda update --all --yes && \
conda config --set auto_update_conda False && \
\
echo "**** cleanup ****" && \
apk del --purge .build-dependencies && \
rm -f miniconda.sh && \
conda clean --all --force-pkgs-dirs --yes && \
find "$CONDA_DIR" -follow -type f \( -iname '*.a' -o -iname '*.pyc' -o -iname '*.js.map' \) -delete && \
\
echo "**** finalize ****" && \
mkdir -p "$CONDA_DIR/locks" && \
chmod 777 "$CONDA_DIR/locks"
# Create the environment:
RUN /opt/conda/bin/conda install --yes --freeze-installed \
tensorflow-gpu \
numpy \
pillow \
tensorflow-estimator \
flask \
nomkl \
&& /opt/conda/bin/conda clean -afy
ENV PATH=/opt/conda/bin:${PATH}
ENV CONTAINER_INSTANCE=True
WORKDIR /app
# # Copy the current directory contents into the container at /app
COPY . /app
# The code to run when container is started:
COPY app.py .
EXPOSE 5000
ENTRYPOINT ["python", "-u", "app.py"]