refactor: 优化缓存目录配置和Dockerfile结构

修改缓存目录配置以支持环境变量覆盖,简化Dockerfile并优化镜像构建步骤
移除冗余权限设置,使用更精简的基础镜像
This commit is contained in:
2026-01-06 19:22:22 +08:00
parent f51e50ec23
commit 745c8cf29b
3 changed files with 8 additions and 22 deletions

View File

@@ -18,7 +18,7 @@ const EventEmitter = require('events');
// Configuration
const PORT = 9520;
const API_BASE = 'http://183.6.121.121:9558/api';
const CACHE_DIR = path.join(__dirname, '.cache');
const CACHE_DIR = process.env.CACHE_DIR ? path.resolve(process.env.CACHE_DIR) : path.join(__dirname, '.cache');
// Ensure cache directory exists
if (!fs.existsSync(CACHE_DIR)) {