mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-10-06 21:39:50 +08:00
feat: 修改nginx配置文件
This commit is contained in:
parent
6f7584b72d
commit
b8473096f8
3 changed files with 11 additions and 9 deletions
|
@ -1,12 +1,10 @@
|
||||||
|
version: '3'
|
||||||
services:
|
services:
|
||||||
nginx1.23.1:
|
nginx1.23.1:
|
||||||
container_name: ${CONTAINER_NAME}
|
container_name: ${CONTAINER_NAME}
|
||||||
image: nginx:1.23.1
|
image: nginx:1.23.1
|
||||||
restart: always
|
restart: always
|
||||||
network_mode: host
|
network_mode: host
|
||||||
ports:
|
|
||||||
- ${PANEL_APP_PORT_HTTP}:80
|
|
||||||
- ${PANEL_APP_PORT_HTTPS}:443
|
|
||||||
volumes:
|
volumes:
|
||||||
- ./conf/nginx.conf:/etc/nginx/nginx.conf
|
- ./conf/nginx.conf:/etc/nginx/nginx.conf
|
||||||
- ./log:/var/log/nginx
|
- ./log:/var/log/nginx
|
||||||
|
|
|
@ -419,6 +419,11 @@ func copyAppData(key, version, installName string, params map[string]interface{}
|
||||||
installDir := path.Join(constant.AppInstallDir, key)
|
installDir := path.Join(constant.AppInstallDir, key)
|
||||||
installVersionDir := path.Join(installDir, version)
|
installVersionDir := path.Join(installDir, version)
|
||||||
fileOp := files.NewFileOp()
|
fileOp := files.NewFileOp()
|
||||||
|
if fileOp.Stat(installVersionDir) {
|
||||||
|
if err = fileOp.DeleteDir(installVersionDir); err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
if err = fileOp.Copy(resourceDir, installVersionDir); err != nil {
|
if err = fileOp.Copy(resourceDir, installVersionDir); err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,13 +43,12 @@ func InitDir() {
|
||||||
constant.BackupDir = path.Join(constant.DefaultDataDir, "backup")
|
constant.BackupDir = path.Join(constant.DefaultDataDir, "backup")
|
||||||
constant.AppBackupDir = path.Join(constant.BackupDir, "apps")
|
constant.AppBackupDir = path.Join(constant.BackupDir, "apps")
|
||||||
|
|
||||||
|
dirs := []string{constant.DefaultDataDir, constant.ResourceDir, constant.AppResourceDir, constant.AppInstallDir, constant.BackupDir, constant.AppBackupDir}
|
||||||
|
|
||||||
fileOp := files.NewFileOp()
|
fileOp := files.NewFileOp()
|
||||||
createDir(fileOp, constant.DefaultDataDir)
|
for _, dir := range dirs {
|
||||||
createDir(fileOp, constant.ResourceDir)
|
createDir(fileOp, dir)
|
||||||
createDir(fileOp, constant.AppResourceDir)
|
}
|
||||||
createDir(fileOp, constant.AppInstallDir)
|
|
||||||
createDir(fileOp, constant.BackupDir)
|
|
||||||
createDir(fileOp, constant.AppBackupDir)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func createDir(fileOp files.FileOp, dirPath string) {
|
func createDir(fileOp files.FileOp, dirPath string) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue