From 1d86fa63bc82ecf09c8c02956addfd843132f842 Mon Sep 17 00:00:00 2001 From: Stanislaw Adaszewski Date: Fri, 8 May 2020 11:26:55 +0200 Subject: [PATCH] Added crontab for nginx --- example/gateway/files/crontab_root | 1 + example/gateway/nginx-http/Fockerfile | 11 +++++++++++ example/gateway/nginx-https/Fockerfile | 6 ++++++ 3 files changed, 18 insertions(+) create mode 100644 example/gateway/files/crontab_root diff --git a/example/gateway/files/crontab_root b/example/gateway/files/crontab_root new file mode 100644 index 0000000..392122f --- /dev/null +++ b/example/gateway/files/crontab_root @@ -0,0 +1 @@ +@weekly service nginx reload >/dev/null 2>&1 diff --git a/example/gateway/nginx-http/Fockerfile b/example/gateway/nginx-http/Fockerfile index 9be8498..101e167 100644 --- a/example/gateway/nginx-http/Fockerfile +++ b/example/gateway/nginx-http/Fockerfile @@ -8,6 +8,8 @@ steps: /root/cookiecutter.json ] - [ files/nginx.conf, /root/nginx.conf ] + - [ ../files/crontab_root, + /root/crontab_root ] - run: - mkdir -p /root/nginx_template/\{\{cookiecutter.directory_name\}\} - mv -v /root/nginx.conf /root/nginx_template/\{\{cookiecutter.directory_name\}\}/nginx.conf @@ -20,3 +22,12 @@ steps: - rm -rvf /root/nginx_template - rm -rvf ./nginx_conf - mkdir -p /certbot/webroot + - run: + - sysrc nginx_enable=YES + - crontab -u root /root/crontab_root + - rm -v /root/crontab_root + - run: + - sysrc sshd_enable=NO + - sysrc sendmail_enable=NONE + - sysrc clear_tmp_enable=YES + - sysrc syslogd_flags="-ss" diff --git a/example/gateway/nginx-https/Fockerfile b/example/gateway/nginx-https/Fockerfile index 8cb0b67..3031316 100644 --- a/example/gateway/nginx-https/Fockerfile +++ b/example/gateway/nginx-https/Fockerfile @@ -8,6 +8,8 @@ steps: /root/cookiecutter.json ] - [ files/nginx.conf, /root/nginx.conf ] + - [ ../files/crontab_root, + /root/crontab_root ] - run: - mkdir -p /root/nginx_template/\{\{cookiecutter.directory_name\}\} - mv -v /root/nginx.conf /root/nginx_template/\{\{cookiecutter.directory_name\}\}/nginx.conf @@ -21,6 +23,10 @@ steps: - rm -rvf ./nginx_conf - mkdir -p /usr/local/etc/letsencrypt - mkdir -p /certbot/webroot + - run: + - sysrc nginx_enable=YES + - crontab -u root /root/crontab_root + - rm -v /root/crontab_root - run: - sysrc sshd_enable=NO - sysrc sendmail_enable=NONE