Compare commits

...

3 Commits
0.3.0 ... main

Author SHA1 Message Date
Paolo Asperti a569e48273
added bitwarden and migrated to debian
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/tag Build is passing Details
2022-10-20 23:30:03 +02:00
Paolo Asperti 6a63e9cd88
don't update crontab file if ENV missing 2022-10-19 22:44:42 +02:00
Paolo Asperti febac4d60f
timezone support
continuous-integration/drone/push Build is passing Details
2022-09-21 08:38:29 +02:00
3 changed files with 18 additions and 10 deletions

View File

@ -16,15 +16,18 @@ services:
volumes:
- ./scripts:/scripts
- ./logs:/var/log
- ./crontabs:/etc/cron.d:ro
environment:
CRONTAB: >
*/5 7-22 * * * /scripts/test.py
*/10 7-22 * * * /scripts/test2.py
TZ: Europe/Rome
```
```bash
mkdir scripts logs
mkdir scripts logs crontabs
touch scripts/test.py && chmod +x scripts/test.py
touch scripts/test2.py && chmod +x scripts/test2.py
cat <<EOF >crontabs/myscripts
*/5 7-22 * * * /scripts/test.py
*/10 7-22 * * * /scripts/test2.py
EOF
docker-compose up -d
```

View File

@ -1,13 +1,20 @@
FROM alpine:3.16
FROM debian:bullseye-slim
COPY logrotate-cron /etc/logrotate.d
COPY entrypoint.sh /
RUN \
mkdir /scripts /crontabs && \
apk -U add python3 py3-pip py3-requests py3-dateutil py3-beautifulsoup4 logrotate && \
pip3 install fdb mysql-connector-python==8.0.29 telepot caldav
apt update && \
DEBIAN_FRONTEND=noninteractive apt -y upgrade && \
DEBIAN_FRONTEND=noninteractive apt -y install wget python3 python3-pip python3-dateutil python3-requests python3-bs4 logrotate unzip tzdata && \
pip3 install fdb mysql-connector-python==8.0.29 telepot caldav && \
wget -O /tmp/bw.zip 'https://vault.bitwarden.com/download/?app=cli&platform=linux' && \
unzip /tmp/bw.zip -d /usr/local/bin && \
chmod +x /usr/local/bin/bw && \
rm /tmp/bw.zip
ENV CRONTAB=""
ENV TZ="Europe/Rome"
ENTRYPOINT ["/bin/sh", "/entrypoint.sh"]

View File

@ -1,5 +1,3 @@
#!/bin/sh
echo "${CRONTAB}" > /crontabs/root
/usr/sbin/crond -f -d8 -L /var/log/cron.log -c /crontabs
/usr/sbin/cron -f -L /var/log/cron.log