diff --git a/Dockerfile b/Dockerfile index c96c0f2..172fe32 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,7 @@ ARG ARCH= -FROM ${ARCH}ubuntu:20.04 +FROM ${ARCH}python:3.12.0-slim-bookworm as builder + +WORKDIR /enviroplus RUN ln -fs /usr/share/zoneinfo/Europe/London /etc/localtime @@ -14,6 +16,15 @@ COPY requirements.txt . RUN pip3 install -r requirements.txt +FROM ${ARCH}python:3.12.0-slim-bookworm + +WORKDIR /enviroplus + +# Make sure you update Python version in path +COPY --from=builder /usr/local/lib/python3.12/site-packages /usr/local/lib/python3.12/site-packages + COPY enviroplus_exporter.py . CMD python3 enviroplus_exporter.py --bind=0.0.0.0 --port=8000 + +# ENTRYPOINT [ "python3", "enviroplus_exporter.py", "--bind=0.0.0.0", "--port=8000" ] \ No newline at end of file