修改docker文件挂载及配置文件读取

This commit is contained in:
junleea 2025-06-13 13:11:18 +08:00
parent cf0f656032
commit 97704ca8d2
2 changed files with 14 additions and 1 deletions

12
docker-compose.yml Normal file
View File

@ -0,0 +1,12 @@
version: '3.8'
services:
app:
image: vp-image:latest
container_name: vp-container
ports:
- "8088:8083"
volumes:
- logs:/var/log/vp.log
- /etc/vp-app:/etc/vp-app
- /data/file:/data/file

View File

@ -62,7 +62,8 @@ func init() {
os.MkdirAll(proto.CID_BASE_DIR+"workspace", os.ModePerm) os.MkdirAll(proto.CID_BASE_DIR+"workspace", os.ModePerm)
//读取配置文件 //读取配置文件
//文件地址/home/videoplayer/vp.conf //文件地址/home/videoplayer/vp.conf
configPath := "/home/videoplayer/vp.conf" //configPath := "/home/videoplayer/vp.conf"
configPath := "/etc/vp-app/vp.conf"
//读取配置文件 //读取配置文件
err := proto.ReadConfig(configPath) err := proto.ReadConfig(configPath)
if err != nil { if err != nil {