Spaces:
Running
Running
# Dockerfile | |
FROM python:3.10-slim | |
WORKDIR /app | |
# tells the system to treat /app as the "home" directory, so Streamlit will create /app/.streamlit instead of /.streamlit. | |
# /app is already writable as root, so no permission issues. | |
ENV HOME=/app | |
# (Optional) system deps if you need them; safe to remove if not needed | |
RUN apt-get update && apt-get install -y --no-install-recommends curl && rm -rf /var/lib/apt/lists/* | |
# Install Python deps | |
COPY requirements.txt /app/ | |
RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt | |
# Copy code | |
COPY . /app | |
# Do NOT set STREAMLIT_SERVER_PORT here. | |
# Spaces will inject $PORT at runtime. | |
# Start Streamlit on the port Spaces provides, and bind to 0.0.0.0 | |
# CMD ["bash", "-lc", "streamlit run /app/frontend.py --server.port $PORT --server.address 0.0.0.0"] | |
# CMD ["sh", "-c", "streamlit run /app/frontend.py --server.port $PORT --server.address 0.0.0.0"] | |
CMD ["streamlit", "run", "/app/frontend.py", "--server.port", "8501", "--server.address", "0.0.0.0"] | |