diff --git a/backend/app/service/runtime.go b/backend/app/service/runtime.go index f4d279031..b1ed2a0db 100644 --- a/backend/app/service/runtime.go +++ b/backend/app/service/runtime.go @@ -495,6 +495,9 @@ func (r *RuntimeService) OperateRuntime(req request.RuntimeOperate) error { _ = runtimeRepo.Save(runtime) } }() + go func() { + _ = docker.CreateDefaultDockerNetwork() + }() switch req.Operate { case constant.RuntimeUp: if err = runComposeCmdWithLog(req.Operate, runtime.GetComposePath(), runtime.GetLogPath()); err != nil { diff --git a/backend/app/service/website.go b/backend/app/service/website.go index 217f92f84..b55ee8a86 100644 --- a/backend/app/service/website.go +++ b/backend/app/service/website.go @@ -309,10 +309,6 @@ func (w WebsiteService) CreateWebsite(create request.WebsiteCreate) (err error) if err != nil { return err } - if err = docker.CreateDefaultDockerNetwork(); err != nil { - err = buserr.WithDetail(constant.Err1PanelNetworkFailed, err.Error(), nil) - return - } website.RuntimeID = runtime.ID switch runtime.Type { case constant.RuntimePHP: