mosquitto: write initial Dockerfile

This commit is contained in:
Starbeamrainbowlabs 2021-04-10 16:04:52 +01:00
parent 909603b4a9
commit 58ce2bddf4
Signed by: sbrl
GPG key ID: 1BE5172E637709C2
4 changed files with 65 additions and 9 deletions

View file

@ -66,6 +66,7 @@ Image | Purpose
`minetest-mapserver`| Dockerised [minetest-mapserver](https://github.com/minetest-mapserver/mapserver) `minetest-mapserver`| Dockerised [minetest-mapserver](https://github.com/minetest-mapserver/mapserver)
`minideb` | Our main base image for (most) other images. Built from [minideb](https://github.com/bitnami/minideb), but customised to use our local apt-cacher-ng instance. `minideb` | Our main base image for (most) other images. Built from [minideb](https://github.com/bitnami/minideb), but customised to use our local apt-cacher-ng instance.
`minideb-node` | `minideb` with the latest Node.js installed via our [apt repository](https://apt.starbeamrainbowlabs.com/) `minideb-node` | `minideb` with the latest Node.js installed via our [apt repository](https://apt.starbeamrainbowlabs.com/)
`mosquitto` | Dockerised Mosquitto MQTT server
`node-serve` | `minideb-node` with [serve](https://www.npmjs.com/package/serve) installed & set as the entrypoint `node-serve` | `minideb-node` with [serve](https://www.npmjs.com/package/serve) installed & set as the entrypoint
`paperless-ng` | Dockerised [paperless-ng](https://github.com/jonaswinkler/paperless-ng) - currently under construction `paperless-ng` | Dockerised [paperless-ng](https://github.com/jonaswinkler/paperless-ng) - currently under construction
`redis` | Dockerised [redis](https://redis.io/), installs the latest stable version `redis` | Dockerised [redis](https://redis.io/), installs the latest stable version
@ -79,8 +80,9 @@ UID | GID | Container | Notes
60 | 60 | minetest-mapserver | 60 | 60 | minetest-mapserver |
70 | 70 | etherpad | 70 | 70 | etherpad |
80 | 80 | serve | Static HTTP Server based on Node.js 80 | 80 | serve | Static HTTP Server based on Node.js
85 | 85 | mosquitto |
90 | 90 | jellyfin | 90 | 90 | jellyfin |
95 | 95 | shiorio | Shiori bookmark system, built from source 95 | 95 | shiori | Shiori bookmark system, built from source
999 | 994 | certbot | The same user & group as fabio, because file permissions 999 | 994 | certbot | The same user & group as fabio, because file permissions
2100 | 2100 | redis | 2100 | 2100 | redis |

View file

@ -0,0 +1,13 @@
ARG REPO_LOCATION
FROM ${REPO_LOCATION}minideb
RUN install_packages mosquitto
COPY ./run.sh /usr/local/bin/run.sh
USER 85:85
VOLUME /srv
ENTRYPOINT [ "/usr/local/bin/run.sh"
CMD [ "start" ]

40
images/mosquitto/run.sh Executable file
View file

@ -0,0 +1,40 @@
#!/usr/bin/env bash
action="${1}";
show_help() {
echo "Usage:" >&2;
echo " run.sh <start|reload>" >&2;
}
log_msg() {
echo "[ ${SECONDS} ] >>> mosquitto:run.sh: $*" >&2;
}
if [[ -z "${action}" ]]; then
show_help;
return 0;
fi
log_msg "Running ${action} action";
case "${action}" in
start )
log_msg "Starting mosquitto";
if [[ ! -e "/srv/mosquitto.conf" ]]; then
log_msg "Warning: No configuration file found at /srv/mosquitto.conf";
fi
exec mosquitto --config-file /srv/mosquitto.conf;
;;
reload )
pid="$(pgrep mosquitto)";
log_msg "Reloading by sending SIGHUP to PID ${pid}";
kill -s HUP "${pid}";
;;
* )
show_help;
;;
esac

View file

@ -0,0 +1 @@
docker