diff --git a/app/Module/Apps/Apps.php b/app/Module/Apps/Apps.php index ab09ce44b..ff8d231bb 100644 --- a/app/Module/Apps/Apps.php +++ b/app/Module/Apps/Apps.php @@ -124,7 +124,7 @@ class Apps self::saveAppConfig($appName, $updateConfig); // 执行docker-compose命令 - $curlPath = "apps/{$command}/{$appName}"; + $curlPath = "app/{$command}/{$appName}"; if ($command === 'up') { $curlPath .= "?callback_url=" . urlencode("http://host.docker.internal:" . env("APP_PORT") . "/api/apps/install/callback?install_num=" . $updateConfig[$prefix . '_num']); } @@ -177,12 +177,6 @@ class Apps return Base::retError('更新状态失败'); } - $res = self::nginxUpdate($appName); - if (Base::isError($res)) { - self::saveAppConfig($appName, ['status' => 'error']); - return $res; - } - // 处理安装成功或卸载成功后的操作 $message = '更新成功'; if ($status == 'installed') { @@ -197,46 +191,6 @@ class Apps return Base::retSuccess($message); } - /** - * 更新nginx配置 - * @param string $appName - * @return array - */ - public static function nginxUpdate(string $appName): array - { - // 获取安装配置信息 - $appConfig = self::getAppConfig($appName); - - // nginx配置文件处理 - $nginxFile = base_path('docker/appstore/apps/' . $appName . '/' . $appConfig['install_version'] . '/nginx.conf'); - $nginxTarget = base_path('docker/appstore/configs/' . $appName . '/nginx.conf'); - $needReload = false; - if (file_exists($nginxTarget)) { - unlink($nginxTarget); - $needReload = true; - } - if (file_exists($nginxFile) && $appConfig['status'] === 'installed') { - copy($nginxFile, $nginxTarget); - $res = self::curl("nginx/test"); - if (Base::isError($res)) { - unlink($nginxTarget); - return $res; - } - $needReload = true; - } - - // 重启nginx - if ($needReload) { - $res = self::curl("nginx/reload"); - if (Base::isError($res)) { - return $res; - } - } - - // 返回结果 - return Base::retSuccess("success"); - } - /** * 获取应用信息 * @param string $appName 应用名称 diff --git a/docker-compose.yml b/docker-compose.yml index a3d81da05..a1df66905 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -39,6 +39,7 @@ services: - "${APP_PORT}:80" - "${APP_SSL_PORT:-}:443" volumes: + - ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf - ./:/var/www networks: extnetwork: diff --git a/docker/appstore/README.md b/docker/appstore/README.md index 659e1e0f9..7ddad6005 100644 --- a/docker/appstore/README.md +++ b/docker/appstore/README.md @@ -3,6 +3,6 @@ Directory structure ``` appstore/ ├── apps/ # Application Directory -├── config/ # Configuration file directory +├── configs/ # Configuration file directory └── logs/ # Log file directory ```