feat: extracting environment variables

This commit is contained in:
ttionya
2022-07-02 22:00:50 +08:00
parent fe11695dbf
commit 9407bf6708
2 changed files with 10 additions and 5 deletions
+9 -4
View File
@@ -4,13 +4,18 @@ LABEL "repository"="https://github.com/ttionya/vaultwarden-backup" \
"homepage"="https://github.com/ttionya/vaultwarden-backup" \ "homepage"="https://github.com/ttionya/vaultwarden-backup" \
"maintainer"="ttionya <git@ttionya.com>" "maintainer"="ttionya <git@ttionya.com>"
ARG USER_NAME="backuptool"
ARG USER_ID="1100"
ENV LOCALTIME_FILE="/tmp/localtime"
COPY scripts/*.sh /app/ COPY scripts/*.sh /app/
RUN chmod +x /app/*.sh \ RUN chmod +x /app/*.sh \
&& apk add --no-cache bash heirloom-mailx p7zip sqlite supercronic tzdata \
&& ln -sf /tmp/localtime /etc/localtime \
&& mkdir -m 777 /bitwarden \ && mkdir -m 777 /bitwarden \
&& addgroup -g 1100 backuptool \ && apk add --no-cache bash heirloom-mailx p7zip sqlite supercronic tzdata \
&& adduser -u 1100 -Ds /bin/sh -G backuptool backuptool && ln -sf "${LOCALTIME_FILE}" /etc/localtime \
&& addgroup -g "${USER_ID}" "${USER_NAME}" \
&& adduser -u "${USER_ID}" -Ds /bin/sh -G "${USER_NAME}" "${USER_NAME}"
ENTRYPOINT ["/app/entrypoint.sh"] ENTRYPOINT ["/app/entrypoint.sh"]
+1 -1
View File
@@ -37,7 +37,7 @@ if [[ "$1" == "restore" ]]; then
fi fi
function configure_timezone() { function configure_timezone() {
ln -sf "/usr/share/zoneinfo/${TIMEZONE}" /tmp/localtime ln -sf "/usr/share/zoneinfo/${TIMEZONE}" "${LOCALTIME_FILE}"
} }
function configure_cron() { function configure_cron() {