Refactor file structure for better Docker organization

This commit is contained in:
netkas 2025-01-14 14:52:59 -05:00
parent 14ad8588b0
commit 1f673aab71
9 changed files with 32 additions and 8 deletions

2
docker/docker.conf Normal file
View file

@ -0,0 +1,2 @@
[www]
clear_env = no

22
docker/entrypoint.sh Normal file
View file

@ -0,0 +1,22 @@
#!/bin/bash
# Banner with cool ASCII art
echo "███████╗ ██████╗ ██████╗██╗ █████╗ ██╗ ██████╗ ██████╗ ██╗ ██╗"
echo "██╔════╝██╔═══██╗██╔════╝██║██╔══██╗██║ ██╔══██╗██╔═══██╗╚██╗██╔╝"
echo "███████╗██║ ██║██║ ██║███████║██║ ██████╔╝██║ ██║ ╚███╔╝ "
echo "╚════██║██║ ██║██║ ██║██╔══██║██║ ██╔══██╗██║ ██║ ██╔██╗ "
echo "███████║╚██████╔╝╚██████╗██║██║ ██║███████╗██████╔╝╚██████╔╝██╔╝ ██╗"
echo "╚══════╝ ╚═════╝ ╚═════╝╚═╝╚═╝ ╚═╝╚══════╝╚═════╝ ╚═════╝ ╚═╝ ╚═╝"
# Check if the environment variable SB_MODE is set to "automated", if not exit.
if [ "$SB_MODE" != "automated" ]; then
echo "SB_MODE is not set to 'automated', exiting..."
exit 1
fi
# Initialize Socialbox
echo "Initializing Socialbox..."
/usr/bin/socialbox init --log-level=${LOG_LEVEL-INFO}
# Run supervisord, final command
/usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf

37
docker/nginx.conf Normal file
View file

@ -0,0 +1,37 @@
http {
include mime.types;
default_type application/octet-stream;
server {
listen 8085;
server_name localhost;
access_log /var/log/access.log;
error_log /var/log/error.log;
root /var/www/html;
index index.php;
# Handle all requests
location / {
try_files $uri $uri/ /index.php?$query_string =503;
autoindex off;
}
location ~ \.php$ {
include fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
# Block any .ht* files
location ~ /\.ht {
deny all;
}
}
}
events {
worker_connections 1024;
}

5
docker/redis.conf Normal file
View file

@ -0,0 +1,5 @@
bind 0.0.0.0
protected-mode yes
port 6379
appendonly yes
requirepass root

47
docker/supervisord.conf Normal file
View file

@ -0,0 +1,47 @@
[supervisord]
logfile=/var/logd.log
logfile_maxbytes=50MB
logfile_backups=10
loglevel=info
user=root
pidfile=/var/run/supervisord.pid
umask=022
nodaemon=true
minfds=1024
minprocs=200
[program:php-fpm]
command=/usr/local/sbin/php-fpm --nodaemonize
autostart=true
autorestart=true
priority=20
stdout_logfile=/var/log/fpm.log
stderr_logfile=/var/log/fpm_error.log
stdout_logfile_maxbytes=20MB
stdout_logfile_backups=5
stderr_logfile_maxbytes=20MB
stderr_logfile_backups=5
[program:nginx]
command=/usr/sbin/nginx -g "daemon off;" -c /etc/nginx/nginx.conf
autostart=true
autorestart=true
priority=10
stdout_logfile=/var/log/nginx.log
stderr_logfile=/var/log/nginx_error.log
stdout_logfile_maxbytes=20MB
stdout_logfile_backups=5
stderr_logfile_maxbytes=20MB
stderr_logfile_backups=5
[program:cron]
command=cron -f -L 15
autostart=true
autorestart=true
priority=30
stdout_logfile=/var/log/cron.log
stderr_logfile=/var/log/cron_error.log
stdout_logfile_maxbytes=20MB
stdout_logfile_backups=5
stderr_logfile_maxbytes=20MB
stderr_logfile_backups=5

10
docker/zz-docker.conf Normal file
View file

@ -0,0 +1,10 @@
[global]
daemonize=no
error_log = /var/log/php_fpm_error.log
log_limit = 1048576
log_level = notice
[www]
listen = 9000
catch_workers_output = yes
decorate_workers_output = no