chore(docker): 可以正常运行

This commit is contained in:
2025-12-17 13:55:46 +08:00
parent ad4cb058fc
commit 12572cbd71
5 changed files with 14 additions and 110 deletions

View File

@@ -44,7 +44,7 @@ RUN docker-php-ext-configure gd --with-freetype --with-jpeg \
sockets
# 安装 Redis 扩展
RUN pecl install redis-5.3.7 && docker-php-ext-enable redis
# RUN pecl install redis-5.3.7 && docker-php-ext-enable redis
# 安装Composer
COPY --from=composer:2.2.25 /usr/bin/composer /usr/bin/composer
@@ -77,11 +77,11 @@ EXPOSE 9000
# nohup php think cron:schedule > /dev/null 2>&1 &
#######################################
# 启动Supervisor
# 添加在Dockerfile末尾CMD命令之前
COPY ./entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/entrypoint.sh
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
# 修改CMD命令
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
# 启动Supervisor
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]

View File

@@ -6,15 +6,8 @@ logfile_backups=10
loglevel=info
pidfile=/var/run/supervisord.pid
[program:chmod]
command=/bin/bash -c "while true; do chmod -R 775 /var/www/html/runtime/ /var/www/html/upload/ 2>/dev/null || true; sleep 30; done"
autostart=true
autorestart=true
stopasgroup=true
killasgroup=true
[program:php-fpm]
command=php-fpm
command=php -S 0.0.0.0:9000
autostart=true
autorestart=true
startretries=3
@@ -26,20 +19,4 @@ stdout_logfile_maxbytes=10MB
stdout_logfile_backups=10
stderr_logfile=/var/log/supervisor/php-fpm-error.log
stderr_logfile_maxbytes=10MB
stderr_logfile_backups=10
[program:think-cron]
command=php /var/www/html/think cron:schedule
process_name=%(program_name)s_%(process_num)02d
numprocs=1
autostart=true
autorestart=true
startretries=3
stdout_logfile=/var/log/supervisor/think-cron.log
stdout_logfile_maxbytes=10MB
stdout_logfile_backups=10
stderr_logfile=/var/log/supervisor/think-cron-error.log
stderr_logfile_maxbytes=10MB
stderr_logfile_backups=10
startsecs=3
stopwaitsecs=10
stderr_logfile_backups=10