-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use cron to execute the script only once per day (#5)
- Loading branch information
Showing
4 changed files
with
27 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,23 @@ | ||
FROM python:3.9.5-slim-buster | ||
|
||
ARG WITHINGS_SYNC_VERSION=v3.2.0 | ||
ARG WITHINGS_SYNC_COMMIT=9153773e4e2ad32ce05f4d2a87c6eb9e8ed80ae2 | ||
ARG TINI_VERSION=v0.19.0 | ||
ARG GIT_VERSION=1:2.20.1-2+deb10u3 | ||
|
||
ADD "https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini" /tini | ||
RUN chmod +x /tini | ||
|
||
COPY entrypoint.sh /entrypoint.sh | ||
ARG CRON_VERSION=3.0pl1-134+deb10u1 | ||
ARG CURL_VERSION=7.64.0-4+deb10u2 | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends git="${GIT_VERSION}" && \ | ||
apt-get install -y --no-install-recommends git="${GIT_VERSION}" cron="${CRON_VERSION}" curl="${CURL_VERSION}" && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* && \ | ||
pip install --no-cache-dir git+https://github.com/jaroslawhartman/withings-sync.git@"${WITHINGS_SYNC_VERSION}" | ||
curl -sL "https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini" -o /tini && \ | ||
chmod +x /tini && \ | ||
pip install --no-cache-dir git+https://github.com/jaroslawhartman/withings-sync.git@"${WITHINGS_SYNC_COMMIT}" | ||
|
||
ENTRYPOINT ["/tini", "--"] | ||
COPY entrypoint.sh /entrypoint.sh | ||
COPY withings-sync /etc/cron.d/withings-sync | ||
|
||
RUN chmod 0644 /etc/cron.d/withings-sync | ||
|
||
ENTRYPOINT ["/tini", "--"] | ||
CMD ["/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0 10 * * * root /usr/local/bin/withings-sync >> /var/log/cron-withings-sync.log 2>&1 |