modified: src/Dockerfile
modified: src/entrypoint.sh
This commit is contained in:
parent
5c33ccf0b1
commit
2ae078bda5
2 changed files with 40 additions and 10 deletions
|
@ -1,11 +1,14 @@
|
||||||
FROM restic/restic:0.9.6
|
FROM restic/restic:0.9.6
|
||||||
|
|
||||||
RUN apk update && apk add python3 dcron mariadb-client postgresql-client
|
RUN apk update && apk add ca-certificates python3 dcron mariadb-client postgresql-client && rm -rf /var/cache/apk/*
|
||||||
|
|
||||||
ADD . /restic-compose-backup
|
ADD . /restic-compose-backup
|
||||||
WORKDIR /restic-compose-backup
|
WORKDIR /restic-compose-backup
|
||||||
RUN pip3 install -U pip setuptools wheel && pip3 install -e .
|
RUN pip3 install -U pip setuptools wheel && pip3 install -e .
|
||||||
ENV XDG_CACHE_HOME=/cache
|
ENV XDG_CACHE_HOME=/cache
|
||||||
|
|
||||||
ENTRYPOINT []
|
VOLUME ["/usr/local/share/ca-certificates"]
|
||||||
CMD ["./entrypoint.sh"]
|
|
||||||
|
ENTRYPOINT ["./entrypoint.sh"]
|
||||||
|
|
||||||
|
CMD []
|
||||||
|
|
|
@ -1,11 +1,38 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# Dump all env vars so we can source them in cron jobs
|
set -e
|
||||||
printenv | sed 's/^\(.*\)$/export \1/g' > /env.sh
|
|
||||||
|
|
||||||
# Write crontab
|
setup_cacerts(){
|
||||||
rcb crontab > crontab
|
|
||||||
|
|
||||||
# start cron in the foreground
|
update-ca-certificates
|
||||||
crontab crontab
|
}
|
||||||
crond -f
|
|
||||||
|
dump_env(){
|
||||||
|
|
||||||
|
# Dump all env vars so we can source them in cron jobs
|
||||||
|
printenv | sed 's/^\(.*\)$/export \1/g' > /env.sh
|
||||||
|
}
|
||||||
|
|
||||||
|
setup_crontab(){
|
||||||
|
|
||||||
|
# Write crontab
|
||||||
|
rcb crontab > crontab
|
||||||
|
|
||||||
|
# start cron in the foreground
|
||||||
|
crontab crontab
|
||||||
|
crond -f
|
||||||
|
}
|
||||||
|
|
||||||
|
start_app(){
|
||||||
|
|
||||||
|
setup_cacerts
|
||||||
|
|
||||||
|
if [ "$1" = '' ]; then
|
||||||
|
dump_env
|
||||||
|
setup_crontab
|
||||||
|
else
|
||||||
|
exec "$@"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
start_app "$@"
|
||||||
|
|
Loading…
Add table
Reference in a new issue