Преглед изворни кода

change docker base image to python3-alpine

subDesTagesMitExtraKaese пре 1 година
родитељ
комит
3a1a933dc6
2 измењених фајлова са 7 додато и 10 уклоњено
  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