This repository has been archived by the owner on Jan 7, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathDockerfile
48 lines (40 loc) · 1.62 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
FROM alpine:3.6
LABEL maintainer="dat.tran@idealo.de"
# Install miniconda
RUN apk --update --repository http://dl-4.alpinelinux.org/alpine/edge/community add \
bash \
git \
curl \
ca-certificates \
bzip2 \
unzip \
sudo \
libstdc++ \
glib \
libxext \
libxrender \
tini \
&& curl -L "https://github.com/andyshinn/alpine-pkg-glibc/releases/download/2.25-r0/glibc-2.25-r0.apk" -o /tmp/glibc.apk \
&& curl -L "https://github.com/andyshinn/alpine-pkg-glibc/releases/download/2.25-r0/glibc-bin-2.25-r0.apk" -o /tmp/glibc-bin.apk \
&& curl -L "https://github.com/andyshinn/alpine-pkg-glibc/releases/download/2.25-r0/glibc-i18n-2.25-r0.apk" -o /tmp/glibc-i18n.apk \
&& apk add --allow-untrusted /tmp/glibc*.apk \
&& /usr/glibc-compat/sbin/ldconfig /lib /usr/glibc-compat/lib \
&& /usr/glibc-compat/bin/localedef -i en_US -f UTF-8 en_US.UTF-8 \
&& rm -rf /tmp/glibc*apk /var/cache/apk/*
RUN echo 'export PATH=/opt/conda/bin:$PATH' > /etc/profile.d/conda.sh && \
curl https://repo.continuum.io/miniconda/Miniconda3-4.3.27-Linux-x86_64.sh -o ~/miniconda.sh && \
/bin/bash ~/miniconda.sh -f -b -p /opt/conda && \
rm ~/miniconda.sh
ENV PATH /opt/conda/bin:$PATH
# Install dependencies via Anaconda
RUN mkdir -p /deploy/app
COPY src/python/project/environment.yml /deploy/app/environment.yml
RUN conda env create -n myapp -f /deploy/app/environment.yml && rm -rf /opt/conda/pkgs/*
ENV PATH /opt/conda/envs/myapp/bin:$PATH
# Deploy application
COPY src/python/project /deploy/app
WORKDIR /deploy/app
# Set Python path
ENV PYTHONPATH=/deploy
EXPOSE 8080
CMD ["python", "app.py"]