This commit is contained in:
parent
2498b8e18a
commit
4da17a1387
11
.drone.yml
11
.drone.yml
@ -4,12 +4,13 @@ name: default
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: check
|
- name: check
|
||||||
image: python:3.11.5-alpine
|
image: docker:24.0.6-cli
|
||||||
|
privileged: true
|
||||||
|
volumes:
|
||||||
|
- name: docker-socket
|
||||||
|
path: /var/run/docker.sock
|
||||||
commands:
|
commands:
|
||||||
- apk add --no-cache poetry
|
- docker build --target check .
|
||||||
- pip install --no-cache-dir poethepoet
|
|
||||||
- poetry install --sync
|
|
||||||
#- poe lint
|
|
||||||
|
|
||||||
- name: build
|
- name: build
|
||||||
image: docker/compose:alpine-1.29.2
|
image: docker/compose:alpine-1.29.2
|
||||||
|
34
Dockerfile
34
Dockerfile
@ -1,13 +1,37 @@
|
|||||||
FROM python:3.11.5-alpine
|
FROM python:3.11.5-alpine as core
|
||||||
|
|
||||||
|
RUN --mount=type=cache,target=/var/cache/apk \
|
||||||
|
apk add poetry
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
FROM core as check
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
RUN apk add --no-cache poetry
|
RUN --mount=type=cache,target=/root/.cache/pip \
|
||||||
|
pip install poethepoet
|
||||||
|
|
||||||
COPY ./poetry.lock ./pyproject.toml ./
|
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
|
||||||
|
|
||||||
|
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
|
RUN poetry install --without dev --sync
|
||||||
|
|
||||||
COPY ./dj-embe ./dj-embe
|
|
||||||
|
|
||||||
CMD poetry run python dj-embe
|
CMD poetry run python dj-embe
|
||||||
|
@ -5,7 +5,9 @@ services:
|
|||||||
container_name: dj-embe
|
container_name: dj-embe
|
||||||
networks:
|
networks:
|
||||||
- apps
|
- apps
|
||||||
build: ./
|
build:
|
||||||
|
context: .
|
||||||
|
target: build
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
apps:
|
apps:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user