-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (26 loc) · 860 Bytes
/
Dockerfile
File metadata and controls
33 lines (26 loc) · 860 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
30
31
32
33
# Phase I - Builder source
FROM python:latest as builder
WORKDIR /usr/src/app
COPY s3bench.py ./
COPY requirements.txt ./
COPY pylint.cfg ./
WORKDIR /wheels
RUN cp /usr/src/app/requirements.txt ./
RUN pip wheel -r ./requirements.txt
# Phase II - Lints Code
FROM eeacms/pylint:latest as linting
WORKDIR /code
COPY --from=builder /usr/src/app/pylint.cfg /etc/pylint.cfg
COPY --from=builder /usr/src/app/s3bench.py ./
RUN ["/docker-entrypoint.sh", "pylint"]
# Phase III - Final Image
FROM python:3.8-slim as serve
WORKDIR /usr/src/app
# Copy all packages instead of rerunning pip install
COPY --from=builder /wheels /wheels
RUN pip install -r /wheels/requirements.txt \
-f /wheels \
&& rm -rf /wheels \
&& rm -rf /root/.cache/pip/*
COPY --from=builder /usr/src/app/*.py ./
ENTRYPOINT ["python3", "./s3bench.py"]