dockerize
This commit is contained in:
6
.dockerignore
Normal file
6
.dockerignore
Normal file
@@ -0,0 +1,6 @@
|
||||
env
|
||||
out
|
||||
res
|
||||
*.toml
|
||||
*.md
|
||||
.git
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1 +1,2 @@
|
||||
out
|
||||
env
|
||||
|
||||
11
Dockerfile
Normal file
11
Dockerfile
Normal file
@@ -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" ]
|
||||
|
||||
7
compose-dev.yaml
Normal file
7
compose-dev.yaml
Normal file
@@ -0,0 +1,7 @@
|
||||
services:
|
||||
nowblinkie:
|
||||
build: .
|
||||
volumes:
|
||||
- "./res:/res"
|
||||
- "./out:/out"
|
||||
- "./config-docker.toml:/config.toml"
|
||||
8
compose.yaml
Normal file
8
compose.yaml
Normal file
@@ -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
|
||||
22
config-docker.toml
Normal file
22
config-docker.toml
Normal file
@@ -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]
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user