19 lines
698 B
Docker
19 lines
698 B
Docker
# 使用 PyTorch 基础镜像
|
|
FROM pytorch/pytorch:2.2.2-cuda12.1-cudnn8-devel
|
|
|
|
# 设置工作目录
|
|
WORKDIR /root/app
|
|
|
|
# 安装必要的包
|
|
RUN pip install --no-cache-dir numpy pandas fastapi uvicorn opencv-python xgboost openpyxl einops joblib scikit-learn mysql-connector-python python-multipart
|
|
RUN apt-get update && apt-get install -y libgl1
|
|
RUN apt-get update && apt-get install -y libglib2.0-0
|
|
|
|
# 将项目文件复制到容器中
|
|
# 如果你想在构建时将项目文件复制到镜像中,可以使用以下命令:
|
|
# COPY ai-station /root/app
|
|
|
|
# 启动 FastAPI 应用
|
|
# 请根据你的项目结构和需要调整命令
|
|
CMD ["uvicorn", "run:app", "--host", "0.0.0.0", "--port", "8000"]
|