forked from caas-team/py-kube-downscaler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
30 lines (18 loc) · 796 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
FROM python:3.10-alpine3.19
WORKDIR /
# Install necessary build tools and dependencies
RUN apk add --no-cache gcc musl-dev libffi-dev python3-dev py3-setuptools
RUN pip3 install poetry
COPY poetry.lock /
COPY pyproject.toml /
RUN poetry config virtualenvs.create false && \
poetry install --no-interaction --no-dev --no-ansi
FROM python:3.10-alpine3.19
WORKDIR /
# copy pre-built packages to this image
COPY --from=0 /usr/local/lib/python3.10/site-packages /usr/local/lib/python3.10/site-packages
# now copy the actual code we will execute (poetry install above was just for dependencies)
COPY kube_downscaler /kube_downscaler
ARG VERSION=dev
RUN sed -i "s/__version__ = .*/__version__ = '${VERSION}'/" /kube_downscaler/__init__.py
ENTRYPOINT ["python3", "-m", "kube_downscaler"]