添加docker ignore

This commit is contained in:
2025-10-26 16:45:26 +08:00
parent 5ccf1523d7
commit 53616f789b
3 changed files with 85 additions and 3 deletions

83
.dockerignore Normal file
View File

@@ -0,0 +1,83 @@
# Git相关
.git
.gitignore
.gitattributes
# Python相关
__pycache__/
*.py[cod]
*$py.class
*.so
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
# 虚拟环境
venv/
env/
ENV/
env.bak/
venv.bak/
# IDE相关
.vscode/
.idea/
*.swp
*.swo
*~
# 操作系统相关
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
# 日志文件
*.log
logs/
# 临时文件
*.tmp
*.temp
.tmp/
# 测试文件
test_*.py
*_test.py
tests/
# 文档
*.md
docs/
# Docker相关
Dockerfile*
docker-compose*.yml
.dockerignore
# 其他
.env
.env.local
.env.*.local
# 数据文件(根据项目需要调整)
data/*

2
.gitignore vendored
View File

@@ -148,7 +148,7 @@ ehthumbs.db
Thumbs.db
# Docker
.dockerignore
# .dockerignore
# Logs
*.log

View File

@@ -8,9 +8,8 @@ COPY requirements.txt .
RUN uv pip install --system -r requirements.txt
# 仅复制除 data 目录外的应用代码
# 仅复制除 data 目录外的应用代码, data 在 dockerignore 中已经被排除
COPY . .
RUN rm -rf ./data
# 暴露端口