dj-embe/Dockerfile

38 lines
604 B
Docker
Raw Normal View History

2023-09-20 22:51:36 +00:00
FROM python:3.11.5-alpine as core
RUN --mount=type=cache,target=/var/cache/apk \
apk add poetry
FROM core as check
2023-09-20 19:57:07 +00:00
WORKDIR /app
2023-09-20 22:51:36 +00:00
RUN --mount=type=cache,target=/root/.cache/pip \
pip install poethepoet
2023-09-20 19:57:07 +00:00
2023-09-20 22:51:36 +00:00
COPY ./poetry.lock ./pyproject.toml poetry.toml ./
2023-09-20 19:57:07 +00:00
2023-09-20 22:51:36 +00:00
RUN --mount=type=cache,target=/root/.cache/pypoetry\
poetry install --sync
2023-09-20 19:57:07 +00:00
2023-09-20 22:51:36 +00:00
COPY ./test ./test
2023-09-20 19:57:07 +00:00
COPY ./dj-embe ./dj-embe
2023-09-20 22:51:36 +00:00
RUN poe lint
#RUN poe test
FROM core as build
WORKDIR /app
COPY ./poetry.lock ./pyproject.toml poetry.toml ./
COPY ./dj-embe ./dj-embe
RUN poetry install --without dev --sync
2023-09-20 19:57:07 +00:00
CMD poetry run python dj-embe