Skip to content

Commit

Permalink
Configure new Octane Docker
Browse files Browse the repository at this point in the history
  • Loading branch information
curtisdelicata committed Jul 1, 2024
1 parent 40c96cf commit c5f16d6
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 12 deletions.
28 changes: 18 additions & 10 deletions .docker/octane/Swoole/supervisord.swoole.conf
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
[supervisord]
nodaemon=true
user=%(ENV_USER)s
logfile=/var/log/supervisor/supervisord.log
pidfile=/var/run/supervisord.pid

[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
Expand All @@ -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]
Expand All @@ -31,12 +28,23 @@ 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
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
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
12 changes: 10 additions & 2 deletions .docker/start-container
Original file line number Diff line number Diff line change
@@ -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
Expand Down
14 changes: 14 additions & 0 deletions .docker/supervisord.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[supervisord]
nodaemon=true
user=%(ENV_USER)s
logfile=/var/log/supervisor/supervisord.log
pidfile=/var/run/supervisord.pid

[unix_http_server]
file=/var/run/supervisor.sock

[supervisorctl]
serverurl=unix:///var/run/supervisor.sock

[rpcinterface:supervisor]
supervisor.rpcinterface_factory=supervisor.rpcinterface:make_main_rpcinterface

0 comments on commit c5f16d6

Please sign in to comment.