feat: 更新 Dockerfile 和配置文件 #202
- 删除 uv.lock 文件,简化依赖管理。 - 新增 api-pip.Dockerfile,设置 Python 环境并安装依赖。
This commit is contained in:
parent
459b357b40
commit
3fa05037d8
@ -16,7 +16,7 @@ services:
|
||||
reservations:
|
||||
devices:
|
||||
- driver: nvidia
|
||||
device_ids: ['2']
|
||||
device_ids: ['1']
|
||||
capabilities: [gpu]
|
||||
ports:
|
||||
- "5050:5050"
|
||||
@ -157,7 +157,7 @@ services:
|
||||
reservations:
|
||||
devices:
|
||||
- driver: nvidia
|
||||
device_ids: ['2']
|
||||
device_ids: ['0']
|
||||
capabilities: [gpu]
|
||||
ports:
|
||||
- "5051:5051"
|
||||
|
||||
35
docker/api-pip.Dockerfile
Normal file
35
docker/api-pip.Dockerfile
Normal file
@ -0,0 +1,35 @@
|
||||
# 使用基础镜像
|
||||
FROM python:3.12
|
||||
|
||||
# 设置工作目录
|
||||
WORKDIR /app
|
||||
|
||||
# 环境变量设置
|
||||
ARG http_proxy
|
||||
ARG https_proxy
|
||||
ENV http_proxy=$http_proxy \
|
||||
https_proxy=$https_proxy \
|
||||
TZ=Asia/Shanghai
|
||||
|
||||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||
|
||||
# 安装系统依赖
|
||||
RUN apt-get update && apt-get install -y \
|
||||
python3-dev \
|
||||
ffmpeg \
|
||||
libsm6 \
|
||||
libxext6 \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# 升级 pip
|
||||
RUN pip install --upgrade pip
|
||||
|
||||
# 复制项目配置文件
|
||||
COPY ../pyproject.toml /app/pyproject.toml
|
||||
|
||||
# 安装依赖项
|
||||
RUN pip install -e .
|
||||
|
||||
# 复制代码到容器中
|
||||
COPY ../src /app/src
|
||||
COPY ../server /app/server
|
||||
@ -22,19 +22,18 @@ RUN apt-get update && apt-get install -y \
|
||||
libsm6 \
|
||||
libxext6
|
||||
|
||||
# 安装依赖项
|
||||
# 复制项目配置文件
|
||||
COPY ../pyproject.toml /app/pyproject.toml
|
||||
COPY ../.python-version /app/.python-version
|
||||
|
||||
# 安装依赖项(不使用lock文件)
|
||||
RUN --mount=type=cache,target=/root/.cache/uv \
|
||||
--mount=type=bind,source=uv.lock,target=uv.lock \
|
||||
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
|
||||
uv sync --frozen --no-install-project
|
||||
uv sync --no-install-project
|
||||
|
||||
# 复制代码到容器中
|
||||
COPY ../src /app/src
|
||||
COPY ../server /app/server
|
||||
COPY ../pyproject.toml /app/pyproject.toml
|
||||
COPY ../.python-version /app/.python-version
|
||||
COPY ../uv.lock /app/uv.lock
|
||||
|
||||
# 同步项目
|
||||
RUN --mount=type=cache,target=/root/.cache/uv \
|
||||
uv sync --frozen
|
||||
uv sync
|
||||
@ -306,7 +306,6 @@ const checkServerHealth = async () => {
|
||||
healthChecking.value = true;
|
||||
const response = await healthApi.check();
|
||||
if (response.status === 'ok') {
|
||||
message.success('服务端连接成功');
|
||||
serverStatus.value = 'ok';
|
||||
} else {
|
||||
serverStatus.value = 'error';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user