emotional-assistant / Dockerfile
Peiiiiiiiiru's picture
Create Dockerfile
9044537 verified
raw
history blame contribute delete
403 Bytes
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"]