forked from lucas-bremond/cesiumpy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
69 lines (39 loc) · 1.34 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
63
64
65
66
67
68
69
# Apache License 2.0
# Base
FROM python:3.9-slim-buster as base
## Update pip
RUN pip install --upgrade pip==20.2
## Configure working directory
WORKDIR /workspace
# Production dependencies
FROM base as prod-deps
## Install dependencies
COPY requirements.txt .
RUN pip install -r requirements.txt
## Copy and install library
COPY . .
RUN pip install .
# Production image
FROM base as prod
LABEL maintainer="[email protected]"
## Install iPython
RUN pip install ipython
## Add library
COPY --from=prod-deps /usr/local/lib/python3.9/site-packages /usr/local/lib/python3.9/site-packages
COPY --from=prod-deps /usr/local/bin /usr/local/bin
## Add license
COPY LICENSE .
## Configure entrypoint
CMD [ "ipython" ]
# Development image
FROM mcr.microsoft.com/vscode/devcontainers/python:0-3.9 as dev
ARG NODE_VERSION="none"
RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi
RUN pip install ipython
COPY requirements-dev.txt /tmp/pip-tmp/
RUN pip3 --disable-pip-version-check --no-cache-dir install -r /tmp/pip-tmp/requirements-dev.txt \
&& rm -rf /tmp/pip-tmp
COPY requirements.txt /tmp/pip-tmp/
RUN pip3 --disable-pip-version-check --no-cache-dir install -r /tmp/pip-tmp/requirements.txt \
&& rm -rf /tmp/pip-tmp
ENV PYTHONPATH /workspace