fix: keep runtime state out of backend images
This commit is contained in:
@@ -1,46 +1,12 @@
|
||||
# 依赖目录
|
||||
node_modules
|
||||
|
||||
# 数据目录
|
||||
data/
|
||||
storage/
|
||||
|
||||
# 环境配置
|
||||
.env
|
||||
.env.local
|
||||
.env.*.local
|
||||
|
||||
# 日志
|
||||
*.log
|
||||
npm-debug.log*
|
||||
|
||||
# 编辑器
|
||||
.idea/
|
||||
.vscode/
|
||||
*.swp
|
||||
*.swo
|
||||
*~
|
||||
|
||||
# 操作系统
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
|
||||
# 测试和开发文件
|
||||
*.test.js
|
||||
*.spec.js
|
||||
test/
|
||||
tests/
|
||||
coverage/
|
||||
|
||||
# 文档
|
||||
*.md
|
||||
!README.md
|
||||
|
||||
# Git
|
||||
.git
|
||||
.gitignore
|
||||
|
||||
# 临时文件
|
||||
*.tmp
|
||||
*.temp
|
||||
.cache/
|
||||
node_modules
|
||||
npm-debug.log*
|
||||
.env
|
||||
.env.*
|
||||
data/*
|
||||
!data/.gitkeep
|
||||
storage/*
|
||||
!storage/.gitkeep
|
||||
tests
|
||||
test_*.js
|
||||
*.bat
|
||||
|
||||
@@ -86,6 +86,13 @@ test('生产部署统一使用 Vite dist 且不会删除 lock 文件', () => {
|
||||
assert.ok(nginxConfig.includes('alias /runtime/downloads/;'));
|
||||
});
|
||||
|
||||
test('Docker 构建上下文排除依赖、环境配置和运行时数据', () => {
|
||||
const dockerIgnore = fs.readFileSync(path.join(projectRoot, 'backend', '.dockerignore'), 'utf8');
|
||||
for (const requiredEntry of ['node_modules', '.env', 'data/*', 'storage/*']) {
|
||||
assert.ok(dockerIgnore.split(/\r?\n/).includes(requiredEntry), requiredEntry);
|
||||
}
|
||||
});
|
||||
|
||||
test('install.sh 生成的 Nginx server 块花括号平衡', () => {
|
||||
const installer = fs.readFileSync(path.join(projectRoot, 'install.sh'), 'utf8');
|
||||
const templates = [...installer.matchAll(/cat > .*?<< EOF\r?\n([\s\S]*?)\r?\nEOF/g)]
|
||||
|
||||
Reference in New Issue
Block a user