File size: 608 Bytes
96bf20d 8a513ca 96bf20d 8a513ca 96bf20d 8a513ca 96bf20d 8a513ca 96bf20d 8a513ca 96bf20d 8a513ca |
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 |
# Use official Python image
FROM python:3.11-slim
# Set working directory
WORKDIR /app
# Set cache directories to avoid permission issues
ENV TRANSFORMERS_CACHE=/tmp/transformers_cache
ENV HF_HOME=/tmp/hf_home
ENV HF_DATASETS_CACHE=/tmp/hf_datasets_cache
ENV HF_METRICS_CACHE=/tmp/hf_metrics_cache
# Copy requirements and app code
COPY requirements.txt .
COPY app.py .
# Install dependencies
RUN pip install --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt
# Expose the default port
EXPOSE 7860
# Command to run the app
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|