update docker

This commit is contained in:
yifeng.wang
2025-03-16 00:30:24 +08:00
parent 35aa778b11
commit bad6cc0995
3 changed files with 17 additions and 16 deletions

View File

@@ -15,20 +15,15 @@ WORKDIR /app
# 安装系统依赖合并为一个RUN命令减少层数 # 安装系统依赖合并为一个RUN命令减少层数
RUN apt-get update && apt-get install -y --no-install-recommends \ RUN apt-get update && apt-get install -y --no-install-recommends \
curl git ffmpeg libsm6 libxext6 xvfb xauth x11-utils \ curl git ffmpeg libsm6 libxext6 xvfb xauth x11-utils \
vim \
build-essential python3-dev \ build-essential python3-dev \
&& apt-get clean \ && apt-get clean \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
# 复制项目文件
COPY owl/ ./owl/
COPY licenses/ ./licenses/
COPY assets/ ./assets/
COPY examples/ ./examples/
COPY README.md .
COPY README_zh.md .
COPY pyproject.toml .
# 创建README.md文件以避免构建错误 # 复制pyproject.toml文件
RUN echo "# OWL Project\n\n这是OWL项目的Docker环境。" > README.md COPY pyproject.toml .
COPY README.md .
# 安装uv工具 # 安装uv工具
RUN pip install uv RUN pip install uv
@@ -38,6 +33,12 @@ RUN uv venv .venv --python=3.10 && \
uv pip install -e . uv pip install -e .
# 复制项目文件
COPY owl/ ./owl/
COPY licenses/ ./licenses/
COPY assets/ ./assets/
COPY examples/ ./examples/
COPY README_zh.md .
# 创建启动脚本 # 创建启动脚本

View File

@@ -1,13 +1,13 @@
services: services:
owl: owl:
# Option 1: Use pre-built image from Docker Hub # Option 1: Use pre-built image from Docker Hub
image: mugglejinx/owl:latest # image: mugglejinx/owl:latest
# Option 2: Build image locally # Option 2: Build image locally
# Uncomment the following lines and comment out the 'image' line above to build locally # Uncomment the following lines and comment out the 'image' line above to build locally
# build: build:
# context: .. context: ..
# dockerfile: .container/Dockerfile dockerfile: .container/Dockerfile
volumes: volumes:
# 挂载.env文件方便配置API密钥 # 挂载.env文件方便配置API密钥
@@ -24,7 +24,7 @@ services:
- PYTHONUNBUFFERED=1 - PYTHONUNBUFFERED=1
- TERM=xterm-256color - TERM=xterm-256color
ports: ports:
- "8000:8000" - "7860:7860"
stdin_open: true stdin_open: true
tty: true tty: true
shm_size: 2gb shm_size: 2gb

View File

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