add cron
This commit is contained in:
parent
11cdca647f
commit
1360195f67
@ -21,9 +21,11 @@ RUN \
|
||||
COPY opt/ /opt
|
||||
COPY etc/ /opt/etc
|
||||
COPY supervisor-mosquitto.conf /etc/supervisor/conf.d/
|
||||
COPY crontab /etc/crontab
|
||||
|
||||
VOLUME /opt/etc
|
||||
VOLUME /opt/data
|
||||
VOLUME /var/log/supervisor
|
||||
|
||||
EXPOSE 80/TCP
|
||||
EXPOSE 443/TCP
|
||||
@ -33,5 +35,5 @@ EXPOSE 9001/tcp
|
||||
|
||||
WORKDIR /opt
|
||||
|
||||
CMD ["env", "LD_LIBRARY_PATH=/opt/lib", "/opt/sbin/mosquitto", "-c", "/opt/etc/mosquitto/mosquitto.conf"]
|
||||
CMD [ "/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf" ]
|
||||
|
||||
|
2
LICENSE
2
LICENSE
@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2019 Wolfgang Hottgenroth
|
||||
Copyright (c) 2019, 2022 Wolfgang Hottgenroth
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
3
crontab
Normal file
3
crontab
Normal file
@ -0,0 +1,3 @@
|
||||
SHELL=/bin/sh
|
||||
PATH=/usr/bin
|
||||
*/2 * * * * root supervisorctl start certbot
|
@ -3,20 +3,25 @@
|
||||
IMAGE=registry.gitlab.com/wolutator/mosquitto-with-auth:latest
|
||||
VOLUME_CONFIG=mosquitto-config
|
||||
VOLUME_DATA=mosquitto-data
|
||||
VOLUME_LOG
|
||||
|
||||
docker volume inspect $VOLUME_CONFIG > /dev/null || docker volume create $VOLUME_CONFIG
|
||||
docker volume inspect $VOLUME_DATA > /dev/null || docker volume create $VOLUME_DATA
|
||||
docker volume inspect $VOLUME_LOG > /dev/null || docker volume create $VOLUME_LOG
|
||||
|
||||
docker pull $IMAGE
|
||||
|
||||
docker run \
|
||||
-d \
|
||||
--rm \
|
||||
-p80:80 \
|
||||
-p443:443 \
|
||||
-p1883:1883 \
|
||||
-p8883:8883 \
|
||||
-p9001:9001 \
|
||||
-v $VOLUME_CONFIG:/opt/etc/mosquitto \
|
||||
-v $VOLUME_DATA:/opt/data \
|
||||
-v $VOLUME_LOG:/var/log/supervisor \
|
||||
--link mariadb \
|
||||
--name mosquitto \
|
||||
$IMAGE
|
||||
|
@ -1,3 +1,7 @@
|
||||
[supervisord]
|
||||
nodaemon=true
|
||||
user=root
|
||||
|
||||
[program:mosquitto]
|
||||
environment=LD_LIBRARY_PATH="/opt/lib"
|
||||
command=/opt/sbin/mosquitto -c /opt/etc/mosquitto/mosquitto.conf
|
||||
@ -8,3 +12,10 @@ autorestart=true
|
||||
command=/usr/bin/certbot renew --standalone
|
||||
autostart=false
|
||||
autorestart=false
|
||||
startsecs=0
|
||||
|
||||
[program:cron]
|
||||
command=/usr/sbin/cron -f
|
||||
autostart=true
|
||||
autorestart=true
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user