🔧 Added Dockerfile for bbs.qotd
authorMalte Bublitz <malte@rolltreppe3.de>
Wed, 12 Nov 2025 16:45:10 +0000 (17:45 +0100)
committerMalte Bublitz <malte@rolltreppe3.de>
Wed, 12 Nov 2025 16:45:10 +0000 (17:45 +0100)
docker_build_qotd.sh [new file with mode: 0755]
qotd.Dockerfile [new file with mode: 0644]

diff --git a/docker_build_qotd.sh b/docker_build_qotd.sh
new file mode 100755 (executable)
index 0000000..324cd48
--- /dev/null
@@ -0,0 +1,43 @@
+#!/usr/bin/env bash
+# 
+# Build the docker image malte70/bbs.qotd
+# 
+# The image version is extracted from the Dockerfile,
+# so make sure to update the "version" label before
+# building a newer version if bbs.qotd!
+# 
+
+cd $(dirname $0)
+
+
+VERSION=$(grep "LABEL version" qotd.Dockerfile | cut -d\" -f2)
+
+
+docker build \
+       -t malte70/bbs.qotd:$VERSION \
+       -t malte70/bbs.qotd:latest \
+       --file qotd.Dockerfile \
+       .
+
+
+# 
+# Run and test the container
+# 
+docker run --rm -d \
+       -p 10017:10017 \
+       --name bbs.qotd \
+       --label=com.centurylinklabs.watchtower.enable=false \
+       malte70/bbs.qotd:$VERSION
+
+# env QOTD_PORT=10017 QOTD_HOST=127.0.0.1 qotd.py
+nc -w 1 127.0.0.1 10017
+
+if [[ $? -ne 0 ]]; then
+       echo "Error: Connecting to bbs.qotd on port 10017 failed." >&2
+       echo "       Aborting now to avoid uploading a defunct image" >&2
+       exit 2
+fi
+
+docker push malte70/bbs.qotd:$VERSION
+docker push malte70/bbs.qotd:latest
+
diff --git a/qotd.Dockerfile b/qotd.Dockerfile
new file mode 100644 (file)
index 0000000..abd01aa
--- /dev/null
@@ -0,0 +1,23 @@
+FROM python:3-slim
+
+COPY . /app
+WORKDIR /app
+#RUN pip install -r requirements.txt
+
+RUN apt-get update && apt-get install -y \
+       fortunes \
+       fortunes-bofh-excuses \
+       fortunes-de
+
+EXPOSE 10017
+
+ENV QOTD_PORT=10017
+
+LABEL org.opencontainers.image.title="Quote of the Day protocol server"
+LABEL org.opencontainers.image.licenses="BSD-2-Clause"
+LABEL org.opencontainers.image.url="https://git.rt3x.de/?p=bbs.git;a=summary"
+LABEL org.opencontainers.image.vendor="malte70"
+LABEL description="A simple Quote of the Day (QOTD) service which uses fortune(6) databases"
+LABEL version="0.1.1"
+
+CMD ["python3", "-m", "bbs.qotd"]