Skip to content

Commit

Permalink
Matomo: try to fix scheduler issues
Browse files Browse the repository at this point in the history
  • Loading branch information
djbe committed Sep 28, 2024
1 parent ff2db96 commit 95a2384
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
3 changes: 3 additions & 0 deletions matomo/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ COPY matomo/config/supervisor/conf.d/ /etc/supervisor/conf.d/
# - init
COPY matomo/scripts/ /

# Configure cron
RUN echo "*/30 * * * * /usr/local/bin/php /var/www/html/console core:archive --verbose --no-interaction" > /etc/crontabs/www-data

# Clean Up
WORKDIR /var/www/html
EXPOSE 8080
Expand Down
11 changes: 11 additions & 0 deletions matomo/config/supervisor/conf.d/crond.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[program:php-fpm]
command=sh -c "crond -f || kill -s SIGQUIT $PPID"

stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0

autorestart=false
startretries=0
stopasgroup=true
5 changes: 4 additions & 1 deletion matomo/scripts/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ start_server() {

# Start services
/entrypoint.sh php-fpm &
nginx
nginx &
sleep 2
}

Expand Down Expand Up @@ -156,6 +156,9 @@ matomo_update_config() {
"mail.encryption=\"$MATOMO_SMTP_ENCRYPTION\""
}

# Just in case, correct permissions
chown -R www-data:www-data .

# Only initialize if we do NOT have a config file
if [ ! -f "$config_file" ]; then
start_server
Expand Down
5 changes: 0 additions & 5 deletions matomo/scripts/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ set -euo pipefail

if [ ! -e matomo.php ]; then
tar cf - --one-file-system -C /usr/src/matomo . | tar xf -
chown -R www-data:www-data .
fi


Expand All @@ -19,10 +18,6 @@ fi
if [ "$1" = 'serve' ]; then
exec /usr/bin/supervisord -c /etc/supervisor/supervisord.conf

# Helper to run cron jobs
elif [ "$1" = 'scheduler' ]; then
exec php console core:archive --verbose --no-interaction

# Init script, for use in initContainers (for example)
elif [ "$1" = 'init' ]; then
exec /bootstrap.sh
Expand Down

0 comments on commit 95a2384

Please sign in to comment.