Spaces:
Running
Running
File size: 758 Bytes
fba0a90 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# Use official Python runtime as a parent image
FROM python:3.9-slim
# Set the working directory in the container
WORKDIR /code
# Copy the dependencies file
COPY requirements.txt .
# Install dependencies
# Upgrade pip to avoid install issues
RUN pip install --no-cache-dir --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt
# Copy the rest of the application code
COPY . .
# Create a writable directory for cache/temp files if needed
# (Optional, but good practice for transformers cache if not pre-downloaded)
RUN mkdir -p /tmp/cache
ENV HF_HOME=/tmp/cache
# Expose the port that HuggingFace Spaces expects (7860)
EXPOSE 7860
# Run the application using Gunicorn
# Bind to 0.0.0.0:7860
CMD ["gunicorn", "-b", "0.0.0.0:7860", "app:app"]
|