stf_model / Dockerfile
andres.salguero
Update project for Hugging Face Spaces
5f21106
raw
history blame contribute delete
696 Bytes
# Use Python 3.10 slim image
FROM python:3.10-slim
# Create a non-root user
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"
# Set working directory
WORKDIR /app
# Copy requirements first to leverage Docker cache
COPY --chown=user ./requirements.txt requirements.txt
# Install dependencies
RUN pip install --no-cache-dir --user -r requirements.txt
# Download NLTK data
RUN python -c "import nltk; nltk.download('punkt')"
# Copy the rest of the application
COPY --chown=user . /app
# Expose the port Hugging Face Spaces uses
EXPOSE 7860
# Command to run the application
CMD ["streamlit", "run", "app.py", "--server.address", "0.0.0.0", "--server.port", "7860"]