-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpython.debian.Dockerfile
44 lines (36 loc) · 1.43 KB
/
python.debian.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
FROM python:3.13-slim
ARG VCS_REF
ARG BUILD_DATE
LABEL org.opencontainers.image.authors="Tobias Hargesheimer <[email protected]>" \
org.opencontainers.image.title="PI-Sensors" \
org.opencontainers.image.description="Raspberry Pi GPIO Sensors (Debian (slim) with Python 3)" \
org.opencontainers.image.licenses="Apache-2.0" \
org.opencontainers.image.created="${BUILD_DATE}" \
org.opencontainers.image.revision="${VCS_REF}" \
org.opencontainers.image.url="https://hub.docker.com/r/tobi312/rpi-sensors/" \
org.opencontainers.image.source="https://github.com/Tob1as/rpi-sensors"
SHELL ["/bin/bash", "-euxo", "pipefail", "-c"]
#COPY *.py /service/
COPY dht_sensor.py /service/
RUN \
#set -ex; \
#mkdir /service ; \
apt-get update; \
BUILD_PACKAGES='gcc libc6-dev libmariadb-dev'; \
apt-get install -y --no-install-recommends \
$BUILD_PACKAGES \
libgpiod2 \
libmariadb3 \
; \
rm -rf /var/lib/apt/lists/*; \
pip3 install --no-cache-dir rpi.gpio==0.7.1; \
#pip3 install --no-cache-dir sysv-ipc==1.1.0; \
pip3 install --no-cache adafruit-blinka==8.43.0 ; \
pip3 install --no-cache-dir adafruit-circuitpython-dht==4.0.5; \
pip3 install --no-cache-dir mariadb==1.1.10; \
pip3 install --no-cache-dir paho-mqtt==2.1.0; \
apt-get remove --purge -y $BUILD_PACKAGES; apt autoremove -y ; \
chmod +x /service/*.py
WORKDIR /service
STOPSIGNAL SIGINT
CMD ["python3", "-u", "./dht_sensor.py"]