|
|
@ -9,6 +9,7 @@ import ( |
|
|
|
"encoding/pem" |
|
|
|
"encoding/pem" |
|
|
|
"errors" |
|
|
|
"errors" |
|
|
|
"fmt" |
|
|
|
"fmt" |
|
|
|
|
|
|
|
"github.com/1Panel-dev/1Panel/backend/utils/docker" |
|
|
|
"os" |
|
|
|
"os" |
|
|
|
"path" |
|
|
|
"path" |
|
|
|
"reflect" |
|
|
|
"reflect" |
|
|
@ -312,6 +313,14 @@ func (w WebsiteService) CreateWebsite(create request.WebsiteCreate) (err error) |
|
|
|
switch runtime.Type { |
|
|
|
switch runtime.Type { |
|
|
|
case constant.RuntimePHP: |
|
|
|
case constant.RuntimePHP: |
|
|
|
if runtime.Resource == constant.ResourceAppstore { |
|
|
|
if runtime.Resource == constant.ResourceAppstore { |
|
|
|
|
|
|
|
client, err := docker.NewDockerClient() |
|
|
|
|
|
|
|
if err != nil { |
|
|
|
|
|
|
|
return err |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
defer client.Close() |
|
|
|
|
|
|
|
if !checkImageExist(client, runtime.Image) { |
|
|
|
|
|
|
|
return buserr.WithName("ErrImageNotExist", runtime.Name) |
|
|
|
|
|
|
|
} |
|
|
|
var ( |
|
|
|
var ( |
|
|
|
req request.AppInstallCreate |
|
|
|
req request.AppInstallCreate |
|
|
|
install *model.AppInstall |
|
|
|
install *model.AppInstall |
|
|
|