Quellcode durchsuchen

change docker base image to python3-alpine

subDesTagesMitExtraKaese vor 1 Jahr
Ursprung
Commit
3a1a933dc6
2 geänderte Dateien mit 7 neuen und 10 gelöschten Zeilen
  1. 5 8
      Dockerfile
  2. 2 2
      requirements.txt

+ 5 - 8
Dockerfile

@@ -1,4 +1,4 @@
-FROM debian:bookworm-slim
+FROM alpine:3.18.4
 
 LABEL maintainer="Christopher Nethercott" \
     description="PiHole to InfluxDB data bridge"
@@ -7,14 +7,11 @@ WORKDIR /app
 
 # Install Python packages
 COPY requirements.txt .
-RUN apt-get update && \
-  apt-get install -y --no-install-recommends python3 python3-pip python3-pandas && \
-  python3 -m pip install -r requirements.txt
+RUN apk add --update --no-cache python3 py3-pip py3-pandas && \
+    python3 -m pip install -r requirements.txt
 
-# Clean up
-RUN apt-get -q -y autoremove && \
-  apt-get -q -y clean && \
-  rm -rf /var/lib/apt/lists/*
+# Cleanup
+RUN rm -rf /var/cache/apk/*
 
 # Final setup & execution
 COPY . /app

+ 2 - 2
requirements.txt

@@ -1,2 +1,2 @@
-influxdb-client=1.38.0
-requests=2.31.0
+influxdb-client==1.38.0
+requests==2.31.0