Skip to content

Commit

Permalink
Fixed crontab and logging bug in docker
Browse files Browse the repository at this point in the history
  • Loading branch information
sasanrose committed Nov 16, 2016
1 parent 79b6cc8 commit 2555a59
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ RUN phpize \

WORKDIR /var/www/html
COPY . phpredmin/
RUN mkdir phpredmin/logs && chown www-data:www-data phpredmin/logs -R

ENV PHPREDMIN_LOG_DRIVER="std"
ENV PHPREDMIN_LOG_THRESHOLD="4"

WORKDIR /var/www/html/phpredmin/public

Expand Down
2 changes: 1 addition & 1 deletion docker/crontab
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Cron tab for phpredmin to collect redis statistics
* * * * * root cd /var/www/html/phpredmin/public && /usr/local/bin/php index.php cron/index
* * * * * root . /root/.profile; cd /var/www/html/phpredmin/public && /usr/local/bin/php index.php cron/index > /dev/stdout 2>&1
2 changes: 2 additions & 0 deletions docker/php.ini
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
variables_order = "EGPCS"
log_errors = On
error_log = /dev/stderr
11 changes: 6 additions & 5 deletions docker/start.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
#! /bin/sh

# Copy PHPREDMIN env variables to .profile for cron jobs
printenv | grep PHPREDMIN | xargs -rl echo "export$1" >> $HOME/.profile

# Run gearman job server
gearmand -d
# Run cron daemon
cron
# Run gearman work
php index.php gearman/index &
# Start web server
apache2-foreground &

# Trap sigkill
trap "pkill gearmand && pkill -WINCH apache2" TERM

wait
# Run gearman work & Start web server
php index.php gearman/index & apache2-foreground

0 comments on commit 2555a59

Please sign in to comment.