added bitwarden and migrated to debian
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing

This commit is contained in:
Paolo Asperti 2022-10-20 01:09:59 +02:00
parent 6a63e9cd88
commit a569e48273
Signed by: paspo
GPG Key ID: 06D46905D19D5182
3 changed files with 16 additions and 12 deletions

View File

@ -16,16 +16,18 @@ services:
volumes:
- ./scripts:/scripts
- ./logs:/var/log
- ./crontabs:/etc/cron.d:ro
environment:
TZ: Europe/Rome
CRONTAB: >
*/5 7-22 * * * /scripts/test.py
*/10 7-22 * * * /scripts/test2.py
```
```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,12 +1,18 @@
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 tzdata && \
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"

View File

@ -1,7 +1,3 @@
#!/bin/sh
if [ ! -z "${CRONTAB}" ] ; then
echo "${CRONTAB}" > /crontabs/roota
fi
/usr/sbin/crond -f -d8 -L /var/log/cron.log -c /crontabs
/usr/sbin/cron -f -L /var/log/cron.log