| FROM python:3.13.5-slim |
|
|
| WORKDIR /app |
|
|
| RUN apt-get update && apt-get install -y \ |
| build-essential \ |
| curl \ |
| git \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| |
| RUN mkdir -p /.streamlit && chmod 777 /.streamlit |
| RUN mkdir -p /root/.streamlit && chmod 777 /root/.streamlit |
| RUN mkdir -p /app/.streamlit && chmod 777 /app/.streamlit |
|
|
| |
| RUN echo '[server]\n\ |
| enableCORS = false\n\ |
| enableXsrfProtection = false\n\ |
| fileWatcherType = "none"\n\ |
| maxUploadSize=200\n\ |
| \n\ |
| [global]\n\ |
| dataFrameSerialization = "arrow"\n\ |
| ' > /app/.streamlit/config.toml |
|
|
| |
| RUN mkdir -p /app/uploads && chmod 777 /app/uploads |
|
|
| COPY requirements.txt ./ |
| COPY src/ ./src/ |
|
|
| |
| |
| RUN sed -i '1i\ |
| import os\n\ |
| \n\ |
| # Création du répertoire uploads s'\''il n'\''existe pas\n\ |
| os.makedirs("uploads", exist_ok=True)\n\ |
| \n\ |
| # Configuration pour le cache Streamlit\n\ |
| if not os.path.exists(".streamlit"):\n\ |
| os.makedirs(".streamlit", exist_ok=True)\n\ |
| ' /app/src/streamlit_app.py |
|
|
| RUN pip3 install -r requirements.txt |
|
|
| |
| RUN chmod -R 777 /app |
| RUN chmod -R 777 /.streamlit |
| RUN chmod -R 777 /root/.streamlit |
|
|
| EXPOSE 8501 |
|
|
| HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health |
|
|
| ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"] |