From a312f7c0d8b3ac9ea928e0cd25f0d780cc64b1ec Mon Sep 17 00:00:00 2001 From: puke <1129090915@qq.com> Date: Wed, 5 Nov 2025 10:43:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96Docker=E4=B8=AD=E7=9A=84uv?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 8 +++++--- docker-compose.yml | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 785b1c7..ef72460 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,14 +20,16 @@ RUN apt-get update && apt-get install -y \ && rm -rf /var/lib/apt/lists/* # Install uv package manager -RUN curl -LsSf https://astral.sh/uv/install.sh | sh +RUN curl -LsSf https://astral.sh/uv/install.sh | sh && \ + export PATH="/root/.cargo/bin:$PATH" && \ + uv --version ENV PATH="/root/.cargo/bin:$PATH" # Copy dependency files first for better layer caching COPY pyproject.toml uv.lock ./ # Install Python dependencies using uv -RUN uv sync --frozen --no-dev +RUN /root/.cargo/bin/uv sync --frozen --no-dev # Copy application code COPY pixelle_video ./pixelle_video @@ -50,5 +52,5 @@ ENV CHROME_BIN=/usr/bin/chromium EXPOSE 8000 8501 # Default command (can be overridden in docker-compose) -CMD ["uv", "run", "python", "api/app.py"] +CMD ["/root/.cargo/bin/uv", "run", "python", "api/app.py"] diff --git a/docker-compose.yml b/docker-compose.yml index 77e470a..fa71750 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,7 +7,7 @@ services: context: . dockerfile: Dockerfile container_name: pixelle-video-api - command: uv run python api/app.py --host 0.0.0.0 --port 8000 + command: /root/.cargo/bin/uv run python api/app.py --host 0.0.0.0 --port 8000 ports: - "8000:8000" volumes: @@ -42,7 +42,7 @@ services: context: . dockerfile: Dockerfile container_name: pixelle-video-web - command: uv run streamlit run web/app.py --server.port 8501 --server.address 0.0.0.0 + command: /root/.cargo/bin/uv run streamlit run web/app.py --server.port 8501 --server.address 0.0.0.0 ports: - "8501:8501" volumes: