Skip to content

Commit fb6684b

Browse files
authored
Merge pull request #4 from Noviconnect/poetry
Poetry for deps
2 parents ef36fb5 + a840112 commit fb6684b

File tree

5 files changed

+866
-10
lines changed

5 files changed

+866
-10
lines changed

Dockerfile

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,29 @@
1-
FROM python:3.12
1+
###
2+
# build compiled wheels
3+
FROM python:3.12 as build
24

35
WORKDIR /
46

5-
COPY release_helper release_helper/
7+
# setup poetry
8+
RUN pip install --no-cache-dir poetry
69

7-
# setup python
8-
COPY requirements.txt .
9-
RUN pip install --no-cache-dir -r requirements.txt
10+
COPY pyproject.toml .
11+
RUN poetry export --format requirements.txt --without-hashes --output requirements.txt
12+
RUN pip wheel --wheel-dir /wheels-base --requirement requirements.txt --debug --verbose
1013

14+
15+
###
16+
# final image
17+
FROM python:3.12 as final
18+
19+
# copy python dependency wheels from build stage
20+
COPY --from=build /wheels-base/ /wheels/
21+
22+
# use wheels to install python dependencies
23+
RUN pip install --no-cache-dir --no-index --find-links=/wheels/ /wheels/* \
24+
&& rm -rf /wheels/
25+
26+
COPY release_helper/ /release_helper/
1127
COPY entrypoint.sh .
1228

1329
ENTRYPOINT ["/entrypoint.sh"]

docker-compose.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
services:
2+
3+
release_helper:
4+
build:
5+
args:
6+
- revision=${GITHUB_SHA:-unknown}
7+
context: .
8+
labels:
9+
org.opencontainers.image.revision: ${GITHUB_SHA:-unknown}
10+
org.opencontainers.image.source: github.com/Noviconnect/release_helper
11+
target: final
12+
command: /entrypoint.sh
13+
image: release_helper

0 commit comments

Comments
 (0)