MCP_Res / Dockerfile
mgbam's picture
Update Dockerfile
eded179 verified
raw
history blame
773 Bytes
FROM python:3.10-slim
# Ensure Streamlit writes to a writable directory
ENV HOME=/app
ENV STREAMLIT_CONFIG_DIR=/app/.streamlit
WORKDIR /app
# Install production dependencies only
COPY requirements.txt .
RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt
# Copy codebase
COPY . .
# Ensure config folder exists with correct permissions
RUN mkdir -p /app/.streamlit && chmod -R 777 /app/.streamlit
# Add minimal Streamlit config
RUN echo "\
[server]\n\
headless = true\n\
port = 8501\n\
address = \"0.0.0.0\"\n\
enableCORS = false\n\
enableXsrfProtection = false\n\
" > /app/.streamlit/config.toml
EXPOSE 8501
# Shell form CMD ensures log output compatibility on Spaces
CMD streamlit run app.py --server.port=8501 --server.address=0.0.0.0