-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
31 lines (25 loc) · 965 Bytes
/
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
From python:3.7-buster as basepython
WORKDIR /opt/app-root/
ENV PATH=/opt/app-root/bin:$PATH
# Create an apt-root dir and set permissions, add a python
# virtual environment and install pip.
RUN /usr/local/bin/python -m venv /opt/app-root/ && \
/opt/app-root/bin/pip install -U pip wheel && \
useradd -m -N -u 1001 -s /bin/bash -g 0 user && \
chown -R 1001:0 /opt/app-root && \
chmod -R og+rx /opt/app-root
# Install the goes_viewer dependencies from requirements.txt and
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt && \
rm requirements.txt
# Build a wheel so we can install it later
FROM basepython as wheelbuild
COPY . /src
RUN cd /src/ && \
python setup.py bdist_wheel
# Install goes_viewer from the built wheel
FROM basepython
COPY --from=wheelbuild /src/dist/*.whl /opt/app-root/.
COPY --from=wheelbuild /src/static /opt/app-root/static
RUN pip install --no-cache-dir /opt/app-root/*.whl
USER 1001