Spaces:
Running
Running
FROM python:3.10-slim | |
WORKDIR /app | |
# Install system dependencies | |
RUN apt-get update && apt-get install -y \ | |
git \ | |
&& rm -rf /var/lib/apt/lists/* | |
# Install Python dependencies | |
COPY requirements.txt . | |
RUN pip install --no-cache-dir -r requirements.txt | |
# Copy the application code | |
COPY . . | |
# Set environment variables | |
ENV PYTHONUNBUFFERED=1 | |
ENV HUGGINGFACE_HUB_CACHE=/app/cache | |
ENV TRANSFORMERS_CACHE=/app/cache | |
# Create cache directory | |
RUN mkdir -p /app/cache | |
# Expose the port the app runs on | |
EXPOSE 7860 | |
# Command to run the application | |
CMD ["python", "app.py"] | |