Spaces:
Paused
Paused
# Use Python 3.12 slim image as base | |
FROM python:3.12-slim | |
# Set working directory | |
WORKDIR /app | |
# Copy requirements first to leverage Docker cache | |
COPY requirements.txt . | |
# Install dependencies | |
RUN pip install --no-cache-dir -r requirements.txt | |
# Create necessary directories and set permissions | |
RUN mkdir -p /app/logs /app/.cache /app/models \ | |
&& chmod 777 /app/logs /app/.cache /app/models | |
# Copy the application code | |
COPY main /app/main | |
COPY ./utils /app/utils | |
# Set environment variables | |
ENV PYTHONPATH=/main | |
ENV PYTHONUNBUFFERED=1 | |
ENV HF_HOME=/app/.cache | |
# Expose the port (Hugging Face API runs on 7680) | |
EXPOSE 7680 | |
# Command to run the application | |
CMD ["python", "-m", "main.app"] | |