From dddc63c97dd54eaf71d24b63ef3f90df71a4e562 Mon Sep 17 00:00:00 2001 From: chunzhi Date: Thu, 29 Feb 2024 21:13:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20docker-entrypoint.sh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker-entrypoint.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 docker-entrypoint.sh diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh new file mode 100644 index 0000000..bb24f1c --- /dev/null +++ b/docker-entrypoint.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +# 修改数据库连接信息 +cp /var/www/sspanel/config/.config.example.php /var/www/sspanel/config/.config.php +cp /var/www/sspanel/config/appprofile.example.php /var/www/sspanel/config/appprofile.php + +# 使用环境变量进行配置 +sed -i "s|'db_host' = 'localhost'|'db_host' = '${DB_HOST}'|g" /var/www/sspanel/config/.config.php +sed -i "s|'db_database' = 'sspanel'|'db_database' = '${DB_DATABASE}'|g" /var/www/sspanel/config/.config.php +sed -i "s|'db_username' = 'sspanel'|'db_username' = '${DB_USERNAME}'|g" /var/www/sspanel/config/.config.php +sed -i "s|'db_password' = 'WWW.1.com'|'db_password' = '${DB_PASSWORD}'|g" /var/www/sspanel/config/.config.php + +# 执行站点初始化 +php /var/www/sspanel/xcat Migration new +php /var/www/sspanel/xcat Tool importAllSettings +php /var/www/sspanel/xcat Tool createAdmin +php /var/www/sspanel/xcat ClientDownload + +# 执行 PHP-FPM +exec php-fpm