-
Notifications
You must be signed in to change notification settings - Fork 10
/
Dockerfile
47 lines (32 loc) · 905 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
42
43
44
45
46
47
ARG PYTHON_VER=3.9
FROM python:${PYTHON_VER} AS base
WORKDIR /usr/src/app
RUN pip install -U pip && \
curl -sSL https://install.python-poetry.org | python3 -
ENV PATH="/root/.local/bin:$PATH"
RUN poetry config virtualenvs.create false
# Install project manifest
COPY poetry.lock pyproject.toml ./
# Install production dependencies
RUN poetry install --no-root
############
# Unit Tests
#
FROM base AS test
COPY . .
RUN poetry install --no-interaction
############
# Runs all necessary linting and code checks
RUN echo 'Running Flake8' && \
flake8 . && \
echo 'Running Black' && \
black --check --diff . && \
echo 'Running Yamllint' && \
yamllint . && \
echo 'Running pydocstyle' && \
pydocstyle .
#############
FROM base as spauto
WORKDIR /usr/src/app/
COPY --from=base /usr/src/app /usr/src/app
ENTRYPOINT ["pytest", "--disable-pytest-warnings", "tests"]