mirror of
https://ghfast.top/https://github.com/aeroxw/tick-stock-panel.git
synced 2026-09-12 15:34:16 +08:00
Merge PR #44: fix(docker) 修复 .env 相对路径覆盖导致每次重建容器丢数据
This commit is contained in:
@@ -12,6 +12,12 @@ services:
|
||||
- "${PORT:-3018}:3018"
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
# 强制固定为容器内绝对路径, 防止 .env 里的 DATA_DIR=./data(开发模式用)
|
||||
# 被 env_file 原样传入容器后按错误的相对路径解析, 写到未挂载卷的目录,
|
||||
# 导致每次 up --build 重建容器都丢数据。environment 优先级高于 env_file,
|
||||
# 无论 .env 怎么写这里都以容器路径为准。
|
||||
- DATA_DIR=/app/data
|
||||
volumes:
|
||||
- ./data:/app/data
|
||||
- ./tiers.yaml:/app/tiers.yaml:ro
|
||||
|
||||
Reference in New Issue
Block a user