Spaces:
Sleeping
Sleeping
chienweichang
commited on
Commit
•
f4286ee
1
Parent(s):
32523fa
Create Dockerfile
Browse files- Dockerfile +18 -0
Dockerfile
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# 使用官方的 Python 映像
|
2 |
+
FROM python:3.10-slim
|
3 |
+
|
4 |
+
# 設置工作目錄
|
5 |
+
WORKDIR /app
|
6 |
+
|
7 |
+
# 複製 requirements.txt 並安裝 Python 依賴
|
8 |
+
COPY requirements.txt .
|
9 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
10 |
+
|
11 |
+
# 複製應用程式碼到容器內
|
12 |
+
COPY . .
|
13 |
+
|
14 |
+
# 暴露端口
|
15 |
+
EXPOSE 7860
|
16 |
+
|
17 |
+
# 運行應用
|
18 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|