添加docker 部署agent

This commit is contained in:
2026-04-13 17:06:02 +08:00
parent 797824d01c
commit a7c2448207
2866 changed files with 1149 additions and 272838 deletions

View File

@@ -1,5 +1,9 @@
FROM php:8.1-apache
# 切换为阿里云 Debian 镜像源(加速国内构建)
RUN sed -i 's|http://deb.debian.org|https://mirrors.aliyun.com|g' /etc/apt/sources.list.d/debian.sources 2>/dev/null || \
sed -i 's|http://deb.debian.org|https://mirrors.aliyun.com|g' /etc/apt/sources.list
# 安装 PHP 扩展
RUN apt-get update && apt-get install -y \
libzip-dev \
@@ -24,6 +28,9 @@ RUN sed -i '/<Directory \/var\/www\/>/,/<\/Directory>/ s/AllowOverride None/Allo
# 设置时区
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
# 关闭 PHP 错误输出到响应体,开启输出缓冲(与 Windows 行为一致)
RUN echo 'display_errors = Off\nerror_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT\noutput_buffering = 4096\nlog_errors = On\nerror_log = /var/log/apache2/php_errors.log' > /usr/local/etc/php/conf.d/production.ini
# 拷贝应用代码
COPY api/ /var/www/html/
COPY env_config.php /var/www/env_config.php

View File

@@ -9,6 +9,10 @@ set -e
echo "[entrypoint] Replacing hardcoded domains in JS files..."
# 默认值(与 .env.example 对应)
# 从 ROOT_DOMAIN 推导子域名docker-compose.yml 通常已注入,这里仅作容器外单跑的兜底)
_ROOT="${ROOT_DOMAIN:-daoqijuyou77.cn}"
SITE_API_URL="${SITE_API_URL:-https://api.${_ROOT}}"
SITE_PAY_NOTIFY_URL="${SITE_PAY_NOTIFY_URL:-https://api.${_ROOT}}"
SITE_API2_URL="${SITE_API2_URL:-https://api2.tscce.cn}"
QQ_CALLBACK_URL="${QQ_CALLBACK_URL:-http://syhd.daoqijuyou77.cn}"
@@ -28,8 +32,6 @@ if [ -f "$QQ_INC" ]; then
fi
# 替换 sample 目录中的硬编码域名
SITE_API_URL="${SITE_API_URL:-https://api.tscce.cn}"
SITE_PAY_NOTIFY_URL="${SITE_PAY_NOTIFY_URL:-http://api.daoqijuyou77.cn}"
for f in /var/www/html/sample/onlinepay/js/common.js; do
if [ -f "$f" ]; then
sed -i "s|var g_RequestAddress = 'https://api.tscce.cn'|var g_RequestAddress = '${SITE_API_URL}'|g" "$f"