mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2024-12-14 08:39:30 +08:00
51 lines
1.4 KiB
Go
51 lines
1.4 KiB
Go
package model
|
|
|
|
import (
|
|
"path"
|
|
|
|
"github.com/1Panel-dev/1Panel/agent/constant"
|
|
)
|
|
|
|
type Runtime struct {
|
|
BaseModel
|
|
Name string `gorm:"not null" json:"name"`
|
|
AppDetailID uint `json:"appDetailId"`
|
|
Image string `json:"image"`
|
|
WorkDir string `json:"workDir"`
|
|
DockerCompose string `json:"dockerCompose"`
|
|
Env string `json:"env"`
|
|
Params string `json:"params"`
|
|
Version string `gorm:"not null" json:"version"`
|
|
Type string `gorm:"not null" json:"type"`
|
|
Status string `gorm:"not null" json:"status"`
|
|
Resource string `gorm:"not null" json:"resource"`
|
|
Port int `json:"port"`
|
|
Message string `json:"message"`
|
|
CodeDir string `json:"codeDir"`
|
|
ContainerName string `json:"containerName"`
|
|
}
|
|
|
|
func (r *Runtime) GetComposePath() string {
|
|
return path.Join(r.GetPath(), "docker-compose.yml")
|
|
}
|
|
|
|
func (r *Runtime) GetEnvPath() string {
|
|
return path.Join(r.GetPath(), ".env")
|
|
}
|
|
|
|
func (r *Runtime) GetPath() string {
|
|
return path.Join(constant.RuntimeDir, r.Type, r.Name)
|
|
}
|
|
|
|
func (r *Runtime) GetFPMPath() string {
|
|
return path.Join(constant.RuntimeDir, r.Type, r.Name, "conf", "php-fpm.conf")
|
|
}
|
|
|
|
func (r *Runtime) GetPHPPath() string {
|
|
return path.Join(constant.RuntimeDir, r.Type, r.Name, "conf", "php.ini")
|
|
}
|
|
|
|
func (r *Runtime) GetLogPath() string {
|
|
return path.Join(r.GetPath(), "build.log")
|
|
}
|