update docker setting

This commit is contained in:
Wendong 2025-03-16 02:44:02 +08:00
parent a98388460a
commit a7c4c06d4e
8 changed files with 22 additions and 22 deletions

View File

@ -35,7 +35,7 @@ var/
.coverage
htmlcov/
# 虚拟环境
# Virtual environments
venv/
ENV/
env/
@ -48,18 +48,18 @@ env/
*.swo
.DS_Store
# 临时文件
# Temporary files
temp_*
*.tmp
*.log
*.bak
# 缓存
# Cache
.cache/
.npm/
.yarn/
# 大型数据文件
# Large data files
*.csv
*.sqlite
*.db
@ -70,5 +70,5 @@ temp_*
*.pkl
*.pickle
# 数据目录
# Data directory
data/

View File

@ -5,6 +5,11 @@ setlocal enabledelayedexpansion
echo 在Windows上构建Docker镜像...
echo Building Docker image on Windows...
REM 设置Docker BuildKit环境变量
REM Set Docker BuildKit environment variables
set DOCKER_BUILDKIT=1
set COMPOSE_DOCKER_CLI_BUILD=1
REM 设置配置变量
REM Set configuration variables
set CACHE_DIR=.docker-cache\pip
@ -110,11 +115,6 @@ if %ERRORLEVEL% EQU 0 (
)
)
REM 设置Docker BuildKit环境变量
REM Set Docker BuildKit environment variables
set DOCKER_BUILDKIT=1
set COMPOSE_DOCKER_CLI_BUILD=1
echo 启用Docker BuildKit加速构建...
echo Enabling Docker BuildKit to accelerate build...

View File

@ -8,6 +8,10 @@ CLEAN_CACHE=0
REBUILD=0
SERVICE=""
# 设置Docker BuildKit环境变量 | Set Docker BuildKit environment variables
export DOCKER_BUILDKIT=1
export COMPOSE_DOCKER_CLI_BUILD=1
# 解析命令行参数 | Parse command line arguments
while [[ $# -gt 0 ]]; do
case "$1" in
@ -65,10 +69,6 @@ if [ ! -f "$COMPOSE_FILE" ]; then
exit 1
fi
# 设置Docker BuildKit环境变量 | Set Docker BuildKit environment variables
export DOCKER_BUILDKIT=1
export COMPOSE_DOCKER_CLI_BUILD=1
echo "启用Docker BuildKit加速构建... | Enabling Docker BuildKit to accelerate build..."
# 清理缓存(如果指定) | Clean cache (if specified)

View File

@ -73,11 +73,11 @@ FREE_SPACE=$(df -h . | awk 'NR==2 {print $4}')
echo "可用磁盘空间 | Available disk space: $FREE_SPACE"
# 检查是否有.env文件 | Check if .env file exists
if [ ! -f "owl/.env" ]; then
echo "警告 | Warning: 未找到owl/.env文件 | owl/.env file not found"
if [ ! -f "../owl/.env" ]; then
echo "警告 | Warning: 未找到../owl/.env文件 | ../owl/.env file not found"
echo "请运行以下命令创建环境变量文件 | Please run the following command to create environment variable file:"
echo "cp owl/.env_template owl/.env"
echo "然后编辑owl/.env文件填写必要的API密钥 | Then edit owl/.env file and fill in necessary API keys"
echo "cp ../owl/.env_template ../owl/.env"
echo "然后编辑../owl/.env文件填写必要的API密钥 | Then edit ../owl/.env file and fill in necessary API keys"
else
echo "环境变量文件已存在 | Environment variable file exists"
fi

View File

@ -13,7 +13,7 @@ services:
# 挂载.env文件方便配置API密钥
- ../owl/.env:/app/owl/.env
# 挂载数据目录
- ./data:/app/data
- ./data:/app/owl/data
# 挂载缓存目录,避免重复下载
- ~/.cache/pip:/root/.pip/cache
- ~/.cache/playwright:/root/.cache/ms-playwright
@ -24,7 +24,7 @@ services:
- PYTHONUNBUFFERED=1
- TERM=xterm-256color
ports:
- "8000:8000"
- "7860:7860"
stdin_open: true
tty: true
shm_size: 2gb

View File

@ -279,7 +279,7 @@ docker-compose up -d
docker-compose exec owl bash
# activate the virtual environment
cd .. && source .venv/bin/activate && cd owl
cd .. && source .venv/bin/activate
playwright install-deps

View File

@ -273,7 +273,7 @@ docker-compose up -d
docker-compose exec owl bash
# 激活虚拟环境
cd .. && source .venv/bin/activate && cd owl
cd .. && source .venv/bin/activate
playwright install-deps

0
examples/__init__.py Normal file
View File