Han888/pose
1
1FROM python:3.9-slim2 3WORKDIR /app4ENV HOME=/app5 6# 安裝必要套件7RUN apt-get update && apt-get install -y \8 build-essential \9 curl \10 git \11 libgl1 \12 libglib2.0-0 \13 && rm -rf /var/lib/apt/lists/*14 15COPY requirements.txt ./16RUN pip3 install --no-cache-dir -r requirements.txt17 18COPY src/ ./src/19 20# 建立 Streamlit 和 Matplotlib config 資料夾並設定權限21RUN mkdir -p $HOME/.streamlit && chmod -R 777 $HOME/.streamlit22RUN mkdir -p $HOME/.config/matplotlib && chmod -R 777 $HOME/.config/matplotlib23RUN pip install --user -r requirements.txt24ENV MPLCONFIGDIR=$HOME/.config/matplotlib25 26EXPOSE 850127 28HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health || exit 129 30ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]31 32 33 34 35 