-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (20 loc) · 762 Bytes
/
Dockerfile
File metadata and controls
29 lines (20 loc) · 762 Bytes
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
FROM python:3.8-slim-buster
RUN groupadd --gid 5000 developer \
&& useradd --home-dir /home/developer --create-home --uid 5000 \
--gid 5000 --shell /bin/sh --skel /dev/null developer
WORKDIR /home/developer
ENV VIRTUAL_ENV=/home/developer/venv
RUN python -m venv $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
RUN chown -R developer:developer $VIRTUAL_ENV
ENV SETUPTOOLS_SCM_PRETEND_VERSION="1.2.3"
COPY requirements.txt .
RUN pip install -r requirements.txt
ENV DEVELOPMENT_PACKAGE_PATH=/home/developer/python_package/
COPY . $DEVELOPMENT_PACKAGE_PATH
RUN chown -R developer:developer $DEVELOPMENT_PACKAGE_PATH
USER developer
RUN pip install --upgrade pip
RUN pip install ipython
RUN cd python_package && python setup.py install
ENTRYPOINT ["ipython"]