From 5b064a14b301d0f5c970d70d7b8ea1849a108db1 Mon Sep 17 00:00:00 2001 From: askiiart Date: Mon, 25 Sep 2023 10:09:02 -0500 Subject: [PATCH] Initial commit --- .drone.yml | 14 ++++++++++++++ Dockerfile | 5 +++++ README.md | 37 +++++++++++++++++++++++++++++++++++++ run.sh | 7 +++++++ 4 files changed, 63 insertions(+) create mode 100644 .drone.yml create mode 100644 Dockerfile create mode 100644 README.md create mode 100755 run.sh diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..97d0944 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,14 @@ +kind: pipeline +name: default + +steps: +- name: build and publish + image: plugins/docker + pull: always + settings: + repo: askiiart/tinyfeed + tags: latest + username: + from_secret: docker_username + password: + from_secret: docker_password \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..7ceddb9 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,5 @@ +FROM golang:alpine +RUN go install github.com/TheBigRoomXXL/tinyfeed@latest +WORKDIR /data +COPY run.sh /data/run.sh +CMD ["/data/run.sh"] \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..97d4465 --- /dev/null +++ b/README.md @@ -0,0 +1,37 @@ +# docker-createrepo_c + +[![Build Status](https://drone.askiiart.net/api/badges/askiiart/docker-tinyfeed/status.svg?ref=refs/heads/main)](https://drone.askiiart.net/askiiart/docker-tinyfeed) + +`tinyfeed` in a Docker container + +## Running + +Example `docker run`: + +```bash +docker run -d -e INTERVAL=300 -v /path/to/feeds.txt:/data/feeds.txt -v /path/to/html:/html docker.askiiart.net/askiiart/tinyfeed +``` + +Example `docker-compose.yml`: + +```yaml +version: '3.7' +services: + tinyfeed: + image: docker.askiiart.net/askiiart/tinyfeed + environment: + - INTERVAL=300 + volumes: + - /path/to/feeds.txt:/data/feeds.txt + - /path/to/html:/html +``` + +## Environment Variables + +| Variable | Description | +| ---------- | ------------------------------------- | +| `INTERVAL` | How often to run tinyfeed, in seconds | + +## Building + +1. Run `docker build .` diff --git a/run.sh b/run.sh new file mode 100755 index 0000000..68e70ac --- /dev/null +++ b/run.sh @@ -0,0 +1,7 @@ +#!/bin/sh +set -e +while : +do + cat /data/feeds.txt | tinyfeed > /tmp/index.html && mv /tmp/index.html /html/index.html + sleep $INTERVAL +done \ No newline at end of file