dj-embe/Dockerfile
Yanis Rigaudeau 857812a58c
Some checks failed
continuous-integration/drone/push Build is failing
add test stage
2023-09-22 00:51:34 +02:00

48 lines
706 B
Docker

FROM python:3.11.5-alpine as core
RUN --mount=type=cache,target=/var/cache/apk \
apk add poetry
FROM core as build
WORKDIR /app
RUN --mount=type=cache,target=/root/.cache/pip \
pip install poethepoet
COPY ./poetry.lock ./pyproject.toml ./poetry.toml ./
RUN --mount=type=cache,target=/root/.cache/pypoetry \
poetry install --sync
COPY ./test ./test
COPY ./dj-embe ./dj-embe
FROM build as check
RUN poe lint
FROM build as test
RUN poe test
FROM core as run
WORKDIR /app
COPY ./poetry.lock ./pyproject.toml ./poetry.toml ./
COPY ./dj-embe ./dj-embe
RUN --mount=type=cache,target=/root/.cache/pypoetry \
poetry install --without dev --sync
CMD poetry run python dj-embe