Spaces:
Sleeping
Sleeping
Upload 11 files
Browse files- Dockerfile +11 -13
Dockerfile
CHANGED
|
@@ -1,9 +1,8 @@
|
|
| 1 |
# ============================================
|
| 2 |
# CLIProxyAPI Plus - Hugging Face Spaces Dockerfile
|
| 3 |
# ============================================
|
| 4 |
-
#
|
| 5 |
-
# -
|
| 6 |
-
# - Streamlit Frontend UI
|
| 7 |
# ============================================
|
| 8 |
|
| 9 |
# ============================================
|
|
@@ -60,22 +59,21 @@ RUN mkdir -p /app/go-server \
|
|
| 60 |
&& mkdir -p /root/.cli-proxy-api \
|
| 61 |
&& mkdir -p /app/logs
|
| 62 |
|
| 63 |
-
# 複製 Go 二進制文件
|
| 64 |
COPY --from=go-builder /build/CLIProxyAPIPlus /app/go-server/CLIProxyAPIPlus
|
| 65 |
-
COPY config.example.yaml /app/config/config.yaml
|
| 66 |
|
| 67 |
-
# 複製 Streamlit 應用
|
| 68 |
-
COPY
|
| 69 |
-
COPY
|
| 70 |
|
| 71 |
# 安裝 Python 依賴
|
| 72 |
RUN pip install --no-cache-dir -r /app/streamlit/requirements.txt
|
| 73 |
|
| 74 |
-
# 複製 Supervisor 配置
|
| 75 |
-
COPY
|
| 76 |
|
| 77 |
-
# 複製啟動腳本
|
| 78 |
-
COPY
|
| 79 |
RUN chmod +x /app/entrypoint.sh
|
| 80 |
|
| 81 |
# 設置環境變數
|
|
@@ -98,5 +96,5 @@ EXPOSE 7860
|
|
| 98 |
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
|
| 99 |
CMD curl -f http://localhost:7860/_stcore/health || exit 1
|
| 100 |
|
| 101 |
-
# 啟動
|
| 102 |
ENTRYPOINT ["/app/entrypoint.sh"]
|
|
|
|
| 1 |
# ============================================
|
| 2 |
# CLIProxyAPI Plus - Hugging Face Spaces Dockerfile
|
| 3 |
# ============================================
|
| 4 |
+
# 此 Dockerfile 假設所有文件都在構建上下文根目錄
|
| 5 |
+
# 適合直接上傳 hf-spaces/ 內容到 HF Space
|
|
|
|
| 6 |
# ============================================
|
| 7 |
|
| 8 |
# ============================================
|
|
|
|
| 59 |
&& mkdir -p /root/.cli-proxy-api \
|
| 60 |
&& mkdir -p /app/logs
|
| 61 |
|
| 62 |
+
# 複製 Go 二進制文件(從構建階段)
|
| 63 |
COPY --from=go-builder /build/CLIProxyAPIPlus /app/go-server/CLIProxyAPIPlus
|
|
|
|
| 64 |
|
| 65 |
+
# 複製 Streamlit 應用(文件在根目錄)
|
| 66 |
+
COPY streamlit_app/ /app/streamlit/
|
| 67 |
+
COPY requirements.txt /app/streamlit/
|
| 68 |
|
| 69 |
# 安裝 Python 依賴
|
| 70 |
RUN pip install --no-cache-dir -r /app/streamlit/requirements.txt
|
| 71 |
|
| 72 |
+
# 複製 Supervisor 配置(文件在根目錄)
|
| 73 |
+
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
| 74 |
|
| 75 |
+
# 複製啟動腳本(文件在根目錄)
|
| 76 |
+
COPY entrypoint.sh /app/entrypoint.sh
|
| 77 |
RUN chmod +x /app/entrypoint.sh
|
| 78 |
|
| 79 |
# 設置環境變數
|
|
|
|
| 96 |
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
|
| 97 |
CMD curl -f http://localhost:7860/_stcore/health || exit 1
|
| 98 |
|
| 99 |
+
# 啟動容器
|
| 100 |
ENTRYPOINT ["/app/entrypoint.sh"]
|