From 6e947c0d407c0589cf65483d981f4f3e6b910599 Mon Sep 17 00:00:00 2001 From: Alpha Chen Date: Sat, 1 Jan 2022 12:08:14 -0800 Subject: [PATCH] send reminder emails in Monica - set up cron and a queue to send reminder emails https://github.com/monicahq/docker/tree/master/.examples/supervisor/apache --- ansible/playbooks/monica/build/Dockerfile | 17 +++++++++++ .../playbooks/monica/build/supervisord.conf | 30 +++++++++++++++++++ ansible/playbooks/monica/main.yml | 7 ++++- 3 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 ansible/playbooks/monica/build/Dockerfile create mode 100644 ansible/playbooks/monica/build/supervisord.conf diff --git a/ansible/playbooks/monica/build/Dockerfile b/ansible/playbooks/monica/build/Dockerfile new file mode 100644 index 0000000..05035f6 --- /dev/null +++ b/ansible/playbooks/monica/build/Dockerfile @@ -0,0 +1,17 @@ +FROM monica:apache + +# Use the default production configuration +RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" + +# supervisord dependencies +RUN set -ex; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + supervisor \ + ; \ + rm -rf /var/lib/apt/lists/* + +COPY supervisord.conf /etc/supervisord.conf + +CMD ["supervisord", "-c", "/etc/supervisord.conf"] diff --git a/ansible/playbooks/monica/build/supervisord.conf b/ansible/playbooks/monica/build/supervisord.conf new file mode 100644 index 0000000..fc395de --- /dev/null +++ b/ansible/playbooks/monica/build/supervisord.conf @@ -0,0 +1,30 @@ +[supervisord] +nodaemon=true +user=root + +[program:cron] +command=cron.sh +autostart=true +autorestart=true + +[program:queue] +process_name=%(program_name)s_%(process_num)02d +command=queue.sh +numprocs=1 +stdout_logfile=/proc/1/fd/1 +stdout_logfile_maxbytes=0 +stderr_logfile=/proc/1/fd/2 +stderr_logfile_maxbytes=0 +autostart=true +autorestart=true +startretries=0 + +[program:httpd] +process_name=%(program_name)s_%(process_num)02d +command=entrypoint.sh apache2-foreground +stdout_logfile=/proc/1/fd/1 +stdout_logfile_maxbytes=0 +stderr_logfile=/proc/1/fd/2 +stderr_logfile_maxbytes=0 +autostart=true +autorestart=true diff --git a/ansible/playbooks/monica/main.yml b/ansible/playbooks/monica/main.yml index 0e54edc..fcd666d 100644 --- a/ansible/playbooks/monica/main.yml +++ b/ansible/playbooks/monica/main.yml @@ -14,14 +14,19 @@ src: php.ini dest: /usr/share/monica/php/uploads.ini + - copy: + src: build + dest: /usr/share/monica + - docker_compose: project_name: monica + build: yes pull: yes definition: version: "3.4" services: app: - image: monica + build: /usr/share/monica/build depends_on: - db ports: