Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files1231236784567891011121314151611121317181920212223202124252627282930312829303132333435363738394041424344454632333435363738394041424349505144454647484950515253545556535455565757# ---------------------------# Base image# ---------------------------# ---- Base Image ----FROM python:3.13-slim
# ---------------------------# Set working directory# ---------------------------# ---- Environment ----ENV PYTHONUNBUFFERED=1 \ PIP_NO_CACHE_DIR=off \ PIP_DISABLE_PIP_VERSION_CHECK=on \ PIP_DEFAULT_TIMEOUT=100 \ LANG=C.UTF-8 \ LC_ALL=C.UTF-8 \ DEBIAN_FRONTEND=noninteractive \ STREAMLIT_HOME=/app/.streamlit
# ---- Workdir ----WORKDIR /app
# ---------------------------# Install system dependencies for WeasyPrint & Streamlit# ---------------------------# ---- System dependencies ----RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential \ libcairo2 \ libcairo2-dev \ libpango-1.0-0 \ libpango1.0-dev \ libgdk-pixbuf2.0-0 \ libgdk-pixbuf2.0-dev \ libgdk-pixbuf-xlib-2.0-0 \ libgdk-pixbuf-xlib-2.0-dev \ libffi-dev \ shared-mime-info \ wget \ git \ && rm -rf /var/lib/apt/lists/*
# ---------------------------# Copy requirements.txt first (for caching)# ---------------------------COPY requirements.txt .
# ---------------------------# Install Python dependencies# ---------------------------RUN pip install --no-cache-dir -r requirements.txt
# ---------------------------# Copy application code# ---------------------------COPY src/ ./src/
# ---------------------------# Make sure we have writable folders# ---------------------------RUN mkdir -p /app/data /app/.streamlit \# ---- Python dependencies ----COPY src/requirements.txt .RUN pip install --upgrade pip setuptools wheelRUN pip install -r requirements.txt
# ---- Copy project ----COPY src/ /app/
# ---- Create writable dirs ----RUN mkdir -p /app/data /app/data/weekly /app/.streamlit \ && chmod -R 777 /app/data /app/.streamlit
# ---------------------------# Expose Streamlit port# ---------------------------# ---- Streamlit config ----RUN mkdir -p $STREAMLIT_HOMERUN echo "\[server]\n\headless=true\n\enableCORS=false\n\port=8501\n\\n\[browser]\n\gatherUsageStats=false\n" > $STREAMLIT_HOME/config.toml
# ---- Entrypoint ----EXPOSE 8501
# ---------------------------# Set default command# ---------------------------CMD ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]ENTRYPOINT ["streamlit", "run", "streamlit_app.py"]Dockerfile+38-38