diff --git a/Dockerfile b/Dockerfile index 803166f..9377398 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM "python:3.7-alpine" +FROM "python:3.11-alpine" LABEL maintainer="Cabillot Julien " COPY app /app @@ -6,7 +6,13 @@ COPY entrypoint.sh /app/entrypoint.sh WORKDIR "/app" -RUN pip install --no-cache-dir --requirement requirements.txt +# ntfy est pas encore dispo en dehors de testing sur alpine actuellement +RUN pip install --no-cache-dir --requirement requirements.txt && \ + wget https://github.com/binwiederhier/ntfy/releases/download/v2.0.1/ntfy_2.0.1_linux_x86_64.tar.gz && \ + tar zxvf ntfy_2.0.1_linux_x86_64.tar.gz && \ + cp -a ntfy_2.0.1_linux_x86_64/ntfy ~/.local/bin && \ + mkdir ~/.config/ntfy && \ + ntfy --help #USER "nobody" diff --git a/app/sms.py b/app/sms.py index 6781863..40a8f35 100644 --- a/app/sms.py +++ b/app/sms.py @@ -159,11 +159,15 @@ if __name__ == "__main__": # Pushbullet print('# Notif pushbullet') pb.push_note("SMS", "From: %s\nDate: %s\n%s" % (messagesR[i]['Phone'], messagesR[i]['Date'], messagesR[i]['Content'])) + + # NTFY + # TODO: exec ntfy publish # Log HTTP print('# Notif HTTP') datam = {'sender' : messagesR[i]['Phone'], 'date': messagesR[i]['Date'], 'content': messagesR[i]['Content']} - r = requests.post(url="https://sms.cabillot.eu", headers={'Content-Type': 'application/json' }, json=datam) + # desactive + #r = requests.post(url="https://sms.cabillot.eu", headers={'Content-Type': 'application/json' }, json=datam) #print(r.status_code) #Save diff --git a/docker-compose.yml b/docker-compose.yml index c402e51..4765a17 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,7 +9,7 @@ services: # Warning: may not work on ARM (ie: odroid n2) cpus: 0.3 cpu_shares: 1024 - pids_limit: 200 + pids_limit: 10 volumes: # To store plain text & json logs - "./data:/app/data"