Spaces:
Runtime error
Runtime error
File size: 590 Bytes
594923c | 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 | FROM python:3.10-slim
WORKDIR /app
# Install dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy all files
COPY . .
# Create instance directory with proper permissions
RUN mkdir -p /app/instance && chmod 777 /app/instance
# Optional: avoid using cached Hugging Face models in root directory
ENV TRANSFORMERS_CACHE=/app/cache
ENV HF_HOME=/app/cache
# Set PYTHONPATH (useful if you're importing from app/)
ENV PYTHONPATH=/app
# HF Spaces default port is 7860
EXPOSE 7860
# Start server
CMD ["gunicorn", "--bind", "0.0.0.0:7860", "main:app"]
|