diff --git a/Dockerfile b/Dockerfile index 18bc6ee..f724e8b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -107,6 +107,8 @@ COPY docker/supervisord.conf /etc/supervisor/conf.d/supervisord.conf # Copy docker.conf & zz-docker.conf for PHP-FPM COPY docker/docker.conf /usr/local/etc/php-fpm.d/docker.conf COPY docker/zz-docker.conf /usr/local/etc/php-fpm.d/zz-docker.conf +# Copy the logging server script over +COPY docker/logger.py /logger.py # Configure php.ini and enable error and log it to /var/log rather than stdout RUN cp /usr/local/etc/php/php.ini-production /usr/local/etc/php/php.ini && \ diff --git a/docker-compose.test.yml b/docker-compose.test.yml index 3f339e8..d57e2ab 100644 --- a/docker-compose.test.yml +++ b/docker-compose.test.yml @@ -22,8 +22,8 @@ services: - shared_network restart: unless-stopped volumes: - - ./coffee_socialbox/config:/etc/config - - ./coffee_socialbox/data:/etc/socialbox + - ./tests/docker/coffee/config:/etc/config + - ./tests/docker/coffee/data:/etc/socialbox environment: # No need to change these values LOG_LEVEL: ${LOG_LEVEL:-debug} @@ -132,8 +132,8 @@ services: - shared_network restart: unless-stopped volumes: - - ./teapot_socialbox/config:/etc/config - - ./teapot_socialbox/data:/etc/socialbox + - ./tests/docker/teapot/config:/etc/config + - ./tests/docker/teapot/data:/etc/socialbox environment: # No need to change these values LOG_LEVEL: ${LOG_LEVEL:-debug} diff --git a/docker/supervisord.conf b/docker/supervisord.conf index f723f44..4485030 100644 --- a/docker/supervisord.conf +++ b/docker/supervisord.conf @@ -10,6 +10,20 @@ nodaemon=true minfds=1024 minprocs=200 +[program:logger] +command=python3 -m /logger.py --port 5131 +autostart=true +autorestart=true +priority=1 +stdout_events_enabled=true +stderr_events_enabled=true +stdout_logfile=/var/log/socialbox.log +stderr_logfile=/var/log/socialbox_error.log +stdout_logfile_maxbytes=20MB +stdout_logfile_backups=5 +stderr_logfile_maxbytes=20MB +stderr_logfile_backups=5 + [program:php-fpm] command=/usr/local/sbin/php-fpm --nodaemonize autostart=true @@ -22,11 +36,6 @@ stdout_logfile_backups=5 stderr_logfile_maxbytes=0 stderr_logfile_backups=5 -[program:php-fpm-log] -command=tail -f /var/log/fpm.log /var/log/fpm_error.log -stdout_events_enabled=true -stderr_events_enabled=true - [program:nginx] command=/usr/sbin/nginx -g "daemon off;" -c /etc/nginx/nginx.conf autostart=true diff --git a/coffee_socialbox/config/socialbox.conf b/tests/docker/coffee/config/socialbox.conf similarity index 100% rename from coffee_socialbox/config/socialbox.conf rename to tests/docker/coffee/config/socialbox.conf diff --git a/teapot_socialbox/config/socialbox.conf b/tests/docker/teapot/config/socialbox.conf similarity index 100% rename from teapot_socialbox/config/socialbox.conf rename to tests/docker/teapot/config/socialbox.conf