-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
45 lines (29 loc) · 1.07 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
FROM ubuntu:20.04 as builder
LABEL maintainer="Ravnoor Singh Gill <[email protected]>"
RUN apt-get update && apt-get upgrade -y \
&& apt-get install -y git \
bash \
wget \
bzip2 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# create a working directory
RUN mkdir /app
WORKDIR /app
RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-py38_23.5.2-0-Linux-x86_64.sh \
&& /bin/bash Miniconda3-py38_23.5.2-0-Linux-x86_64.sh -b -p /opt/conda \
&& rm Miniconda3-py38_23.5.2-0-Linux-x86_64.sh
ENV PATH=/opt/conda/bin:$PATH
RUN conda install --yes cmake \
&& conda clean -ya
COPY app/requirements.txt /app/requirements.txt
RUN pip install -r /app/requirements.txt
# production image
FROM ubuntu:20.04
ENV TZ=America/Montreal
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
COPY --from=builder /opt/conda /opt/conda
ENV PATH=/opt/conda/bin:$PATH
COPY app/ /app/
RUN chmod -R 777 /app && chmod +x /app/inference.py
CMD ["python3"]