# Use an official Python image | |
FROM python:3.9-slim | |
# Set working directory | |
WORKDIR /app | |
# Copy your app files | |
COPY . /app | |
# Install dependencies | |
RUN pip install --no-cache-dir -r requirements.txt | |
# Create a writable .streamlit directory to avoid permission issues | |
RUN mkdir -p /tmp/.streamlit | |
ENV STREAMLIT_HOME=/tmp/.streamlit | |
# Expose the correct port for Hugging Face Spaces (7860 is their default for Streamlit) | |
EXPOSE 7860 | |
# Start the Streamlit app | |
CMD ["streamlit", "run", "sentiment_huggingface.py", "--server.headless=true", "--server.port=7860", "--server.address=0.0.0.0"] | |