forked from ps-jay/pyraven-mqtt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
41 lines (25 loc) · 800 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
32
33
34
35
36
37
38
39
40
41
FROM python:3.9-slim AS base
ARG PIP_NO_CACHE_DIR=1
RUN pip install -U pip pipenv
ADD Pipfile* /tmp/
WORKDIR /tmp
RUN pipenv install --system --ignore-pipfile
WORKDIR /app
##----------------------------------------------------------------------
FROM base AS testing
WORKDIR /tmp
RUN pipenv install --system --dev --ignore-pipfile
ADD *.py /app/
RUN chmod a+rw /app
WORKDIR /app
##----------------------------------------------------------------------
FROM testing AS pylint
ADD .pylintrc /tmp
ARG PYTHONPATH=.
RUN pylint --rcfile "/tmp/.pylintrc" *.py
##----------------------------------------------------------------------
FROM base AS runtime
# Ensure all testing has been run when using BuildKit
COPY --from=pylint /app/*.py /app/
WORKDIR /app
ENTRYPOINT ["python", "pyrmqtt.py"]