From e6380b7c223ac33bf8c5b88a3ff4c720c747ba84 Mon Sep 17 00:00:00 2001 From: Akbar Rahman Date: Fri, 15 May 2026 17:20:10 +0100 Subject: [PATCH] dockerize --- .dockerignore | 6 ++++++ .gitignore | 1 + Dockerfile | 11 +++++++++++ compose-dev.yaml | 7 +++++++ compose.yaml | 8 ++++++++ config-docker.toml | 22 ++++++++++++++++++++++ readme.md | 6 ++++++ 7 files changed, 61 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 compose-dev.yaml create mode 100644 compose.yaml create mode 100644 config-docker.toml diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..ce0a549 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,6 @@ +env +out +res +*.toml +*.md +.git diff --git a/.gitignore b/.gitignore index 1fcb152..c32684b 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ out +env diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..dd1409d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM python:3.14 + +WORKDIR /usr/src/app + +COPY requirements.txt ./ +RUN pip install --no-cache-dir -r requirements.txt + +COPY . . + +CMD [ "python", "./src/main.py", "-c", "/config.toml" ] + diff --git a/compose-dev.yaml b/compose-dev.yaml new file mode 100644 index 0000000..8e54706 --- /dev/null +++ b/compose-dev.yaml @@ -0,0 +1,7 @@ +services: + nowblinkie: + build: . + volumes: + - "./res:/res" + - "./out:/out" + - "./config-docker.toml:/config.toml" diff --git a/compose.yaml b/compose.yaml new file mode 100644 index 0000000..acecede --- /dev/null +++ b/compose.yaml @@ -0,0 +1,8 @@ +services: + nowblinkie: + build: "https://git.alv.cx/alvierahman90/nowblinkie" + volumes: + - "./res:/res" + - "./out:/out" + - "./config-docker.toml:/config.toml" + restart: unless-stopped diff --git a/config-docker.toml b/config-docker.toml new file mode 100644 index 0000000..8352db8 --- /dev/null +++ b/config-docker.toml @@ -0,0 +1,22 @@ +[loop] +enable = true # run process in a loop, default: false +sleep = 60 # (seconds) time to sleep between generating images, default: 60 + +[[image]] +output = "/out/itistoday.gif" # required +template = "/res/templates/pastel rainbow border.gif" +# size=[120, 20] # specify size if template is not specified +command = ["/usr/bin/date", "+It is %a %d %b"] # required, command to generate text + +font = "/res/curie.bdf" # required, only BDF fonts are supported atm +text_filters = [ "lowercase" ] # text_filters available: lowercase, uppercase +text_offset = [24, 4] # offset the text to move it around the image, default: [0, 0] + +[[image]] +output = "/out/uptime.gif" +template = "/res/templates/pastel rainbow border.gif" +command = ["bash", "-c", "/usr/bin/uptime -p | cut -d, -f-2"] + +font = "/res/curie.bdf" +text_filters = [ "lowercase" ] +text_offset = [21, 4] diff --git a/readme.md b/readme.md index 7d1cf78..80e1b49 100644 --- a/readme.md +++ b/readme.md @@ -8,6 +8,12 @@ using the output of arbitrary commands. 1. install requirements: `pip install -r requirements.txt` 2. run: `python main/src.py [-c config-file] [-L]`. +## docker + +a [dockerfile](./dockerfile) and [compose file](./compose.yaml) have been provided. +keep in mind the commands will run in the docker container, too. +you do not need to clone this repository to use the compose file provided. + ## config the provided [example config file](./config.toml) lists all the options that can be used.