From bad6cc0995291b44642f62ba417d317bec6b340d Mon Sep 17 00:00:00 2001 From: "yifeng.wang" <3038880699@qq.com> Date: Sun, 16 Mar 2025 00:30:24 +0800 Subject: [PATCH] update docker --- .container/Dockerfile | 21 +++++++++++---------- .container/docker-compose.yml | 10 +++++----- README.md | 2 +- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/.container/Dockerfile b/.container/Dockerfile index 2393ed9..ca83e41 100644 --- a/.container/Dockerfile +++ b/.container/Dockerfile @@ -15,20 +15,15 @@ WORKDIR /app # 安装系统依赖(合并为一个RUN命令减少层数) RUN apt-get update && apt-get install -y --no-install-recommends \ curl git ffmpeg libsm6 libxext6 xvfb xauth x11-utils \ + vim \ build-essential python3-dev \ && apt-get clean \ && 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文件以避免构建错误 -RUN echo "# OWL Project\n\n这是OWL项目的Docker环境。" > README.md +# 复制pyproject.toml文件 +COPY pyproject.toml . +COPY README.md . + # 安装uv工具 RUN pip install uv @@ -38,6 +33,12 @@ RUN uv venv .venv --python=3.10 && \ uv pip install -e . +# 复制项目文件 +COPY owl/ ./owl/ +COPY licenses/ ./licenses/ +COPY assets/ ./assets/ +COPY examples/ ./examples/ +COPY README_zh.md . # 创建启动脚本 diff --git a/.container/docker-compose.yml b/.container/docker-compose.yml index e099627..b467f1f 100644 --- a/.container/docker-compose.yml +++ b/.container/docker-compose.yml @@ -1,13 +1,13 @@ services: owl: # Option 1: Use pre-built image from Docker Hub - image: mugglejinx/owl:latest + # image: mugglejinx/owl:latest # Option 2: Build image locally # Uncomment the following lines and comment out the 'image' line above to build locally - # build: - # context: .. - # dockerfile: .container/Dockerfile + build: + context: .. + dockerfile: .container/Dockerfile volumes: # 挂载.env文件,方便配置API密钥 @@ -24,7 +24,7 @@ services: - PYTHONUNBUFFERED=1 - TERM=xterm-256color ports: - - "8000:8000" + - "7860:7860" stdin_open: true tty: true shm_size: 2gb diff --git a/README.md b/README.md index 954fe8d..6b09e12 100644 --- a/README.md +++ b/README.md @@ -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