Add Dockerfile and docker-compose.yml
This commit is contained in:
parent
6e0d57a7dc
commit
48e780fd20
13
Dockerfile
Normal file
13
Dockerfile
Normal 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
2
crontab
Normal 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
5
docker-compose.yml
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
services:
|
||||
ausweisstatus:
|
||||
container_name: ausweisstatus
|
||||
build: .
|
||||
@ -4,8 +4,7 @@
|
||||
# status has changed since the last execution
|
||||
|
||||
# Usage: ./notify.sh <P|R|ID> <Seriennummer> <Geburtsdatum>
|
||||
|
||||
WEBHOOK_URL=""
|
||||
# also set WEBHOOK_URL env var
|
||||
|
||||
notify() {
|
||||
message="New status for $2 ($3): $1"
|
||||
@ -31,6 +30,8 @@ if [[ -e ./cache/"$2" ]]; then
|
||||
else
|
||||
echo "No status change for $2"
|
||||
fi
|
||||
else
|
||||
echo "No previous state found, caching current status for $2"
|
||||
fi
|
||||
|
||||
mkdir -p ./cache
|
||||
|
||||
Loading…
Reference in New Issue
Block a user