Spaces:
Runtime error
Runtime error
Create dockerfile
Browse files- dockerfile +25 -0
dockerfile
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# 使用官方的 Python 基礎映像
|
| 2 |
+
FROM python:3.10
|
| 3 |
+
|
| 4 |
+
# 安裝 Rust 和 Cargo
|
| 5 |
+
RUN apt-get update && apt-get install -y curl \
|
| 6 |
+
&& curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh \
|
| 7 |
+
&& source $HOME/.cargo/env
|
| 8 |
+
|
| 9 |
+
# 安裝其他必要的依賴
|
| 10 |
+
RUN apt-get update && apt-get install -y git git-lfs ffmpeg libsm6 libxext6 cmake rsync libgl1-mesa-glx
|
| 11 |
+
|
| 12 |
+
# 設置工作目錄
|
| 13 |
+
WORKDIR /app
|
| 14 |
+
|
| 15 |
+
# 複製 requirements.txt 到容器中
|
| 16 |
+
COPY requirements.txt .
|
| 17 |
+
|
| 18 |
+
# 安裝 Python 依賴
|
| 19 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 20 |
+
|
| 21 |
+
# 複製專案的其他檔案到容器中
|
| 22 |
+
COPY . .
|
| 23 |
+
|
| 24 |
+
# 設定容器啟動後的指令
|
| 25 |
+
CMD ["python", "app.py"]
|