Spaces:
Runtime error
Runtime error
File size: 403 Bytes
9044537 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
FROM python:3.9
# 創建非 root 使用者
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"
# 設置工作目錄
WORKDIR /app
# 複製依賴並安裝
COPY --chown=user ./requirements.txt requirements.txt
RUN pip install --no-cache-dir --upgrade -r requirements.txt
# 複製應用程式檔案
COPY --chown=user . /app
# 執行 Flask 應用程式
CMD ["python", "app.py"]
|