|
|
@@ -124,20 +124,20 @@ class Start
|
|
|
|
|
|
$log = file_get_contents(ROOT_DIR . '/config/logrotate/log.conf');
|
|
|
$log = str_replace('{{containerName}}', $name, $log);
|
|
|
- file_put_contents($directory . '/config/logrotate.conf', $log);
|
|
|
- system("sudo cp -f {$directory}/config/logrotate.conf /etc/logrotate.d/{$name}");
|
|
|
+ file_put_contents($directory . 'config/logrotate.conf', $log);
|
|
|
+ system("sudo cp -f {$directory}config/logrotate.conf /etc/logrotate.d/{$name}");
|
|
|
// 写入项目变量 Found orphan containers
|
|
|
- file_put_contents($directory . '/config/.env', "COMPOSE_PROJECT_NAME={$name}");
|
|
|
+ file_put_contents($directory . 'config/.env', "COMPOSE_PROJECT_NAME={$name}");
|
|
|
// 启动容器
|
|
|
- system("docker-compose -p {$name} -f {$directory}/config/docker.yml up -d");
|
|
|
+ system("docker-compose -p {$name} -f {$directory}config/docker.yml up -d");
|
|
|
// 重载Nginx
|
|
|
system("docker exec nginx nginx -s reload");
|
|
|
$this->getConnection()->query('commit');
|
|
|
} catch (\Throwable $e) {
|
|
|
echo "exception:" . $e->__toString() . "\n";
|
|
|
$this->getConnection()->query('rollback');
|
|
|
- if (file_exists($directory . '/config/docker.yml')) {
|
|
|
- system("docker-compose -p {$name} -f {$directory}/config/docker.yml rm -s -f");
|
|
|
+ if (file_exists($directory . 'config/docker.yml')) {
|
|
|
+ system("docker-compose -p {$name} -f {$directory}config/docker.yml rm -s -f");
|
|
|
}
|
|
|
$redis = $this->getRedis();
|
|
|
$lockKey = static::IP_LOCK_KEY . $ip;
|