diff --git a/.docker/octane/Swoole/supervisord.swoole.conf b/.docker/octane/Swoole/supervisord.swoole.conf index 15db3ac2..8a8e1d23 100644 --- a/.docker/octane/Swoole/supervisord.swoole.conf +++ b/.docker/octane/Swoole/supervisord.swoole.conf @@ -1,12 +1,6 @@ -[supervisord] -nodaemon=true -user=%(ENV_USER)s -logfile=/var/log/supervisor/supervisord.log -pidfile=/var/run/supervisord.pid - -[program:octane] +k[program:octane] process_name=%(program_name)s_%(process_num)02d -command=php %(ENV_ROOT)s/artisan octane:start --server=swoole --host=0.0.0.0 --port=80 +command=php %(ENV_ROOT)s/artisan octane:start --server=swoole --host=0.0.0.0 --port=8000 user=%(ENV_USER)s autostart=true autorestart=true @@ -22,7 +16,10 @@ command=php %(ENV_ROOT)s/artisan horizon user=%(ENV_USER)s autostart=%(ENV_WITH_HORIZON)s autorestart=true -stdout_logfile=%(ENV_ROOT)s/horizon.log +stdout_logfile=%(ENV_ROOT)s/storage/logs/horizon.log +stdout_logfile_maxbytes=200MB +stderr_logfile=%(ENV_ROOT)s/storage/logs/horizon.log +stderr_logfile_maxbytes=200MB stopwaitsecs=3600 [program:scheduler] @@ -31,7 +28,10 @@ command=supercronic -overlapping /etc/supercronic/laravel user=%(ENV_USER)s autostart=%(ENV_WITH_SCHEDULER)s autorestart=true -stdout_logfile=%(ENV_ROOT)s/scheduler.log +stdout_logfile=%(ENV_ROOT)s/storage/logs/scheduler.log +stdout_logfile_maxbytes=200MB +stderr_logfile=%(ENV_ROOT)s/storage/logs/scheduler.log +stderr_logfile_maxbytes=200MB [program:clear-scheduler-cache] process_name=%(program_name)s_%(process_num)02d @@ -39,4 +39,12 @@ command=php %(ENV_ROOT)s/artisan schedule:clear-cache user=%(ENV_USER)s autostart=%(ENV_WITH_SCHEDULER)s autorestart=false -stdout_logfile=%(ENV_ROOT)s/scheduler.log \ No newline at end of file +startsecs=0 +startretries=1 +stdout_logfile=%(ENV_ROOT)s/storage/logs/scheduler.log +stdout_logfile_maxbytes=200MB +stderr_logfile=%(ENV_ROOT)s/storage/logs/scheduler.log +stderr_logfile_maxbytes=200MB + +[include] +files=/etc/supervisor/supervisord.conf diff --git a/.docker/start-container b/.docker/start-container index 0bab02bc..8816674f 100644 --- a/.docker/start-container +++ b/.docker/start-container @@ -1,15 +1,23 @@ -#!/usr/bin/env bash +#!/usr/bin/env sh set -e -container_mode=${CONTAINER_MODE:-http} +container_mode=${CONTAINER_MODE:-"http"} octane_server=${OCTANE_SERVER} +running_migrations_and_seeders=${RUNNING_MIGRATIONS_AND_SEEDERS:-"false"} + echo "Container mode: $container_mode" initialStuff() { + php artisan storage:link; \ php artisan optimize:clear; \ php artisan event:cache; \ php artisan config:cache; \ php artisan route:cache; + + if [ ${running_migrations_and_seeders} = "true" ]; then + echo "Running migrations and seeding database ..." + php artisan migrate --isolated --seed --force; + fi } if [ "$1" != "" ]; then