File tree Expand file tree Collapse file tree 6 files changed +21
-12
lines changed Expand file tree Collapse file tree 6 files changed +21
-12
lines changed Original file line number Diff line number Diff line change 5
5
# * * * * * - time options, see more https://crontab.guru/
6
6
# flock - lock files are used to determine if a script or application is already running
7
7
# >> - append, > renew log file
8
- # >>/var/log/cron.log 2>&1 - send output to log
9
- # >/dev/null 2>&1 - send output to black hole
8
+ # >> /var/log/cron.log 2>&1 - send output to log
9
+ # > /dev/null 2>&1 - send output to black hole
10
10
# 2>&1 redirects the output include both the Standard Error and Standard Out. Look details https://tldp.org/LDP/abs/html/io-redirection.html
11
11
12
12
# Example
20
20
# WordPress cron run by system cron
21
21
*/30 * * * * 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
22
22
23
- # Remove wp-cron log file once a week
24
- #1 3 * * 2 rm /var/log/cron/wp-cron.log >/dev/null 2>&1
25
23
26
24
# Backup database and media
27
25
15 3 * * * start-backup.sh daily >> /var/log/cron.log 2>&1
Original file line number Diff line number Diff line change 2
2
# Edit .template file to change settings
3
3
4
4
location ^~ /wp-login.php {
5
- auth_basic "Restricted Area: Look password in .env.secret ";
5
+ auth_basic "Restricted Area";
6
6
auth_basic_user_file /etc/nginx/auth/.wplogin;
7
7
8
8
include /etc/nginx/conf.d/partials/php.conf;
Original file line number Diff line number Diff line change @@ -41,6 +41,9 @@ server {
41
41
42
42
include /etc/nginx/conf.d/partials/logs.conf;
43
43
44
+ # Check and include Basic Auth config (15-setup-basic-auth.sh)
45
+ include /etc/nginx/conf.d/partials/basic_auth_${APP_BA}.conf;
46
+
44
47
include /etc/nginx/conf.d/partials/wordpress.conf;
45
48
46
49
include /etc/nginx/conf.d/partials/php.conf;
Original file line number Diff line number Diff line change
1
+ # Based on https://habr.com/ru/company/redmadrobot/blog/305364/
2
+ # https://github.com/renskiy/cron-docker-image
3
+ # Thanks to renskiy
4
+
1
5
FROM alpine:3.14
2
6
3
7
RUN set -ex \
Original file line number Diff line number Diff line change @@ -28,17 +28,15 @@ if [ "$MODE" == "weekly" ]; then
28
28
fi
29
29
30
30
31
-
32
-
33
- # Create backups directory (if not exist)
34
- mkdir -p " $BACKUPS_DIR "
35
- mkdir -p " $BACKUPS_DIR " /" $MODE "
36
-
37
31
# Check is backup enable
38
32
if [ ! " $APP_WP_BACKUP_ENABLE " ] || [ " $APP_WP_BACKUP_ENABLE " == 0 ]; then
39
33
echo " [Fail] Backup is disabled in .env file" ; exit 1;
40
34
fi
41
35
36
+ # Create backups directory (if not exist)
37
+ mkdir -p " $BACKUPS_DIR "
38
+ mkdir -p " $BACKUPS_DIR " /" $MODE "
39
+
42
40
# Wait 3 times
43
41
for i in {1..3}
44
42
do
51
49
fi
52
50
done
53
51
54
-
55
52
# Make database backup
56
53
docker exec " $DATABASE_CONTAINER " \
57
54
mysqldump -u " $MYSQL_ROOT_USER " --password=" $MYSQL_ROOT_PASSWORD " " $MYSQL_DATABASE " \
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
3
+ # Based on https://habr.com/ru/company/redmadrobot/blog/305364/
4
+ # https://github.com/renskiy/cron-docker-image
5
+ # Thanks to renskiy
6
+
7
+ # Stop when error
8
+ set -e
9
+
3
10
# setting user for additional cron jobs
4
11
case $1 in
5
12
-u=* |--user=* )
You can’t perform that action at this time.
0 commit comments