Add Dockerfile and docker-compose.yml

This commit is contained in:
Adrian Groh 2025-06-26 15:26:55 +02:00
parent 6e0d57a7dc
commit 48e780fd20
Signed by: Gobidev
GPG Key ID: 3AA3153E98B0D771
4 changed files with 23 additions and 2 deletions

13
Dockerfile Normal file
View File

@ -0,0 +1,13 @@
FROM alpine:latest
RUN apk add --no-cache bash curl py-pip
COPY . /ausweisstatus
WORKDIR /ausweisstatus
RUN python3 -m venv .venv
RUN source .venv/bin/activate && pip3 install -r requirements.txt
COPY crontab /etc/crontabs/root
CMD ["crond", "-f"]

2
crontab Normal file
View File

@ -0,0 +1,2 @@
* * * * * cd /ausweisstatus && WEBHOOK_URL="url_here" ./notify.sh P L7AAAAAAAA 01.01.1970 >> /var/log/L7 2>&1
* * * * * cd /ausweisstatus && WEBHOOK_URL="url_here" ./notify.sh R C7AAAAAAAA 01.01.1970 >> /var/log/C7 2>&1

5
docker-compose.yml Normal file
View File

@ -0,0 +1,5 @@
---
services:
ausweisstatus:
container_name: ausweisstatus
build: .

View File

@ -4,8 +4,7 @@
# status has changed since the last execution # status has changed since the last execution
# Usage: ./notify.sh <P|R|ID> <Seriennummer> <Geburtsdatum> # Usage: ./notify.sh <P|R|ID> <Seriennummer> <Geburtsdatum>
# also set WEBHOOK_URL env var
WEBHOOK_URL=""
notify() { notify() {
message="New status for $2 ($3): $1" message="New status for $2 ($3): $1"
@ -31,6 +30,8 @@ if [[ -e ./cache/"$2" ]]; then
else else
echo "No status change for $2" echo "No status change for $2"
fi fi
else
echo "No previous state found, caching current status for $2"
fi fi
mkdir -p ./cache mkdir -p ./cache