web / Dockerfile
homerfu's picture
Upload 18 files
f70eb93 verified
Raw History Blame Contribute Delete
707 Bytes
# 使用官方 Python 基礎映像
FROM python:3.10-slim
# 設定工作目錄
WORKDIR /app
# 安裝系統依賴(包含 libgomp,用於 LightGBM 等)
RUN apt-get update && \
apt-get install -y --no-install-recommends libgomp1 && \
rm -rf /var/lib/apt/lists/*
# 複製需求檔案
COPY requirements.txt .
# 安裝 Python 依賴
RUN pip install --no-cache-dir -r requirements.txt
# 複製應用程式程式碼
COPY . .
# 暴露 Streamlit 端口
EXPOSE 8501
# 啟動 Streamlit(非互動模式,跳過歡迎訊息)
CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0", "--server.headless=true", "--browser.gatherUsageStats=false"]