mirror of https://github.com/1Panel-dev/1Panel
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
749 B
28 lines
749 B
package compose
|
|
|
|
import "os/exec"
|
|
|
|
func Up(filePath string) (string, error) {
|
|
cmd := exec.Command("docker-compose", "-f", filePath, "up", "-d")
|
|
stdout, err := cmd.CombinedOutput()
|
|
return string(stdout), err
|
|
}
|
|
|
|
func Down(filePath string) (string, error) {
|
|
cmd := exec.Command("docker-compose", "-f", filePath, "down")
|
|
stdout, err := cmd.CombinedOutput()
|
|
return string(stdout), err
|
|
}
|
|
|
|
func Restart(filePath string) (string, error) {
|
|
cmd := exec.Command("docker-compose", "-f", filePath, "restart")
|
|
stdout, err := cmd.CombinedOutput()
|
|
return string(stdout), err
|
|
}
|
|
|
|
func Rmf(filePath string) (string, error) {
|
|
cmd := exec.Command("docker-compose", "-f", filePath, "rm", "-f")
|
|
stdout, err := cmd.CombinedOutput()
|
|
return string(stdout), err
|
|
}
|