From 417528f8cdedc75a82d362e1f96d398c4a6ddaa4 Mon Sep 17 00:00:00 2001 From: zcr Date: Tue, 30 Dec 2025 16:52:20 +0800 Subject: [PATCH] =?UTF-8?q?feat=20:=20=E4=BB=A3=E7=A0=81=E6=A2=B3=E7=90=86?= =?UTF-8?q?=20=E7=A7=BB=E9=99=A4=E6=89=80=E6=9C=89=E6=95=8F=E6=84=9F?= =?UTF-8?q?=E5=AF=86=E9=92=A5=20=E9=80=9A=E8=BF=87=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=E5=8F=98=E9=87=8F=E6=96=B9=E5=BC=8F=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 22 ++++++++++++++++++++++ docker-compose.yml | 13 +++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..d134880 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,22 @@ +FROM python:3.12-slim + +# Install uv. +COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/ + +# Copy the application into the container. +COPY . /app + +# Install the application dependencies. +WORKDIR /app +RUN mkdir /seg_cache +# 更新索引并安装替代包 +RUN apt-get update && apt-get install -y \ + vim \ + libgl1 \ + libglib2.0-0 \ + && rm -rf /var/lib/apt/lists/* + +RUN uv sync --frozen --no-cache + +# Run the application. +CMD ["/app/.venv/bin/fastapi", "run", "app/main.py", "--port", "80", "--host", "0.0.0.0"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..154252c --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,13 @@ +services: + aida_server: + build: + context: . + dockerfile: Dockerfile + working_dir: /app + volumes: + - ./app:/app/app + - ./.env_prod:/app/.env + - /etc/localtime:/etc/localtime:ro + - ./seg_cache:/seg_cache + ports: + - "10200:80" \ No newline at end of file