-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
271 additions
and
219 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# This is crontab file. Here you can customize your cron-jobs. | ||
# Changes will apply after file save. Container restart not need | ||
# | ||
|
||
# * * * * * - time options, see more https://crontab.guru/ | ||
# flock - lock files are used to determine if a script or application is already running | ||
# >> - append, > renew log file | ||
# >> /var/log/cron.log 2>&1 - send output to log | ||
# > /dev/null 2>&1 - send output to black hole | ||
# 2>&1 redirects the output include both the Standard Error and Standard Out. Look details https://tldp.org/LDP/abs/html/io-redirection.html | ||
|
||
# Example | ||
# * * * * * [flock -n <path-to-lck-file>] <some-command> >> <path-to-log-file> 2>&1 | ||
# * * * * * [flock -n <path-to-lck-file>] <some-command> > /dev/null 2>&1 | ||
|
||
|
||
|
||
# Let's run! | ||
|
||
# WordPress cron run by system cron | ||
*/10 * * * * docker exec ${APP_NAME}_wordpress flock -n /var/log/wordpress/wp-cron.lck php /var/www/html/wp-cron.php >> /var/log/cron.log 2>&1 | ||
|
||
|
||
# Backup database and media | ||
15 3 * * * start-backup.sh daily >> /var/log/cron.log 2>&1 | ||
15 4 * * 1 start-backup.sh weekly >> /var/log/cron.log 2>&1 | ||
|
||
# An empty line is required at the end of this file for a valid cron file |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,7 @@ | |
|
||
|
||
# App info | ||
APP_NAME=YourAppName | ||
APP_NAME=your_app_name | ||
APP_TYPE=wordpress | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
# Do not edit .conf file, it will override by script. | ||
# Edit .template file to change settings | ||
|
||
root /var/www/html; | ||
|
||
error_log /var/log/nginx/error.log; | ||
#access_log /var/log/nginx/access.log; | ||
access_log off; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Do not edit .conf file, it will override by script. | ||
# Edit .template file to change settings | ||
|
||
ssl_certificate /etc/nginx/ssl/${APP_DOMAIN}.crt; | ||
ssl_certificate_key /etc/nginx/ssl/${APP_DOMAIN}.key; | ||
|
||
ssl_protocols TLSv1.2 TLSv1.3; | ||
|
||
# Recommendations from https://raymii.org/s/tutorials/Strong_SSL_Security_On_nginx.html | ||
ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH'; | ||
ssl_prefer_server_ciphers on; | ||
ssl_session_cache shared:SSL:10m; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Based on https://habr.com/ru/company/redmadrobot/blog/305364/ | ||
# https://github.com/renskiy/cron-docker-image | ||
# Thanks to renskiy | ||
|
||
FROM alpine:3.14 | ||
|
||
RUN set -ex \ | ||
# Install bash | ||
&& apk add --no-cache \ | ||
bash \ | ||
# Install docker-cli only. We need just run `docker exec` command, we do not need 'Docker-in-Docker' | ||
# https://jpetazzo.github.io/2015/09/03/do-not-use-docker-in-docker-for-ci/ | ||
docker-cli \ | ||
# Add GNU tar | ||
tar \ | ||
# WordPress backups dir | ||
&& mkdir -p /srv/wordpress/backups \ | ||
# Cron log dir (ToDo 101 Systematize logs in one place.) | ||
&& mkdir -p /var/log/cron \ | ||
# making logging pipe | ||
&& mkfifo -m 0666 /var/log/cron.log \ | ||
&& ln -s /var/log/cron.log /var/log/crond.log | ||
|
||
COPY start-cron.sh /usr/local/bin | ||
RUN chmod +x /usr/local/bin/start-cron.sh | ||
|
||
COPY start-backup.sh /usr/local/bin | ||
RUN chmod +x /usr/local/bin/start-backup.sh | ||
|
||
CMD ["start-cron.sh"] |
Oops, something went wrong.