-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
62 lines (44 loc) · 1.32 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
54
55
56
57
58
59
60
61
62
# syntax=docker/dockerfile:latest
FROM python:alpine as base
RUN mkdir -p /censere /BUILD/censere
ENV PIP_ROOT_USER_ACTION=ignore
RUN pip install --upgrade pip
WORKDIR "/BUILD/censere"
#####################################################
FROM base as builder
# Keep this early to maximize the docker layer cache re-use
RUN apk add --no-cache \
build-base \
freetype-dev \
gcc \
libffi-dev \
make \
musl-dev \
openblas \
openblas-dev
RUN pip3 install --upgrade build
# pre-install the time-consuming bits (pandas etc)
# so we can make use of the docker layer cache...
RUN pip install --user --no-warn-script-location \
Cython \
dash \
dash-core-components \
dash-html-components \
dash-table \
numpy \
pandas \
peewee
ADD setup.py pyproject.toml *.md /BUILD/censere/
ADD censere /BUILD/censere/censere/
RUN pip install --user --no-warn-script-location .
RUN ls -al $HOME/.local/
#####################################################
FROM base as production
RUN apk add --no-cache \
libstdc++ \
openblas
# copy the wheel from the build stage
COPY --from=builder /root/.local /root/.local
ENV PATH=/root/.local/bin:$PATH
RUN pip list --format=freeze > /root/requirements.txt
ENTRYPOINT ["/root/.local/bin/mars-censere"]