From c1e9da5c6f602f8fbdd4161bd11c03690d1b2c15 Mon Sep 17 00:00:00 2001 From: koalasat Date: Thu, 18 Jul 2024 01:33:47 +0200 Subject: [PATCH] Test entrypoint --- docker-compose.yml | 5 +++-- docker/strfry/Dockerfile | 11 +++++++++++ docker/strfry/crontab | 24 ++++++++++++++++++++++++ docker/strfry/entrypoint.sh | 3 +++ docker/strfry/{config => }/strfry.conf | 0 5 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 docker/strfry/Dockerfile create mode 100644 docker/strfry/crontab create mode 100755 docker/strfry/entrypoint.sh rename docker/strfry/{config => }/strfry.conf (100%) diff --git a/docker-compose.yml b/docker-compose.yml index afabaeb9..472fc72c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -227,12 +227,13 @@ services: - ./node/db:/var/lib/postgresql/data strfry: - image: dockurr/strfry:0.9.6 + build: ./docker/strfry + command: /app/strfry.sh container_name: strfry-dev restart: unless-stopped volumes: - ./node/strfry/db:/app/strfry-db - - ./docker/strfry/config/strfry.conf:/etc/strfry.conf:r + - ./docker/strfry:/etc/strfry network_mode: service:tor # # Postgresql for CLN diff --git a/docker/strfry/Dockerfile b/docker/strfry/Dockerfile new file mode 100644 index 00000000..eb0bb4a2 --- /dev/null +++ b/docker/strfry/Dockerfile @@ -0,0 +1,11 @@ +FROM dockurr/strfry:0.9.6 + +USER root + +RUN apk add --no-cache dcron + +RUN crontab -u root /etc/crontab + +ENTRYPOINT ["/etc/entrypoint.sh"] + +CMD ["$@"] \ No newline at end of file diff --git a/docker/strfry/crontab b/docker/strfry/crontab new file mode 100644 index 00000000..ea94fd2a --- /dev/null +++ b/docker/strfry/crontab @@ -0,0 +1,24 @@ +# Edit this file to introduce tasks to be run by cron. +# +# Each task to run has to be defined through a single line +# indicating with different fields when the task will be run +# and what command to run for the task +# +# To define the time you can provide concrete values for +# minute (m), hour (h), day of month (dom), month (mon), +# and day of week (dow) or use '*' in these fields (for 'any'). +# +# Notice that tasks will be started based on the cron's system +# daemon's notion of time and timezones. +# +# Output of the crontab jobs (including errors) is sent through +# email to the user the crontab file belongs to (unless redirected). +# +# For example, you can run a backup of all your user accounts +# at 5 a.m every week with: +# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/ +# +# For more information see the manual pages of crontab(5) and cron(8) +# +# m h dom mon dow command +*/1 * * * * bash '/app/strfry sync wss://nostr.satstralia.com --dir both >> /var/log/cron.log 2>&1' \ No newline at end of file diff --git a/docker/strfry/entrypoint.sh b/docker/strfry/entrypoint.sh new file mode 100755 index 00000000..5ea34c77 --- /dev/null +++ b/docker/strfry/entrypoint.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +crond -f -l 8 \ No newline at end of file diff --git a/docker/strfry/config/strfry.conf b/docker/strfry/strfry.conf similarity index 100% rename from docker/strfry/config/strfry.conf rename to docker/strfry/strfry.conf