Add nextcloud cron and fix certbot cron

This commit is contained in:
Wojciech Kozlowski 2017-09-17 13:01:11 +01:00
parent 9b80571567
commit 36ac328d40
5 changed files with 56 additions and 2 deletions

View File

@ -1,9 +1,11 @@
FROM debian
RUN apt update && apt install -y certbot cron
RUN apt update && apt install -y certbot cron supervisor
ADD certbot.cron /etc/cron.d/certbot
VOLUME ["/etc/letsencrypt"]
CMD ["cron", "-f"]
COPY supervisord.conf /etc/supervisord.conf
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisord.conf"]

9
certbot/supervisord.conf Normal file
View File

@ -0,0 +1,9 @@
[supervisord]
nodaemon=true
[program:cron]
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
command=cron -f

View File

@ -59,6 +59,14 @@ services:
- vol_nextcloud:/var/www/html
restart: always
nextcloud-cron:
container_name: nextcloud_cron
build: nextcloud/cron
image: nextcloud-cron
volumes_from:
- nextcloud-app
restart: always
nextcloud:
container_name: docker_cloud
image: nginx

13
nextcloud/cron/Dockerfile Normal file
View File

@ -0,0 +1,13 @@
FROM nextcloud:fpm
RUN apt-get update && apt-get install -y \
supervisor \
cron \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir /var/log/supervisord /var/run/supervisord && \
echo "*/15 * * * * su - www-data -s /bin/bash -c \"php -f /var/www/html/cron.php\""| crontab -
COPY supervisord.conf /etc/supervisor/supervisord.conf
CMD ["/usr/bin/supervisord"]

View File

@ -0,0 +1,22 @@
[supervisord]
nodaemon=true
logfile=/var/log/supervisord/supervisord.log
pidfile=/var/run/supervisord/supervisord.pid
childlogdir=/var/log/supervisord/
logfile_maxbytes=50MB ; maximum size of logfile before rotation
logfile_backups=10 ; number of backed up logfiles
loglevel=error
[program:php-fpm]
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
command=php-fpm
[program:cron]
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
command=cron -f