Spaces:
Running
Running
File size: 682 Bytes
c660b8d a261c04 c660b8d 4e7a6e5 a261c04 a2aaca5 a261c04 a2aaca5 a261c04 2012bae c660b8d |
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 30 31 32 33 |
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/*
RUN mkdir -p .cache/hub
RUN mkdir -p .cache/modules
RUN chmod -R 777 .cache/hub
RUN chmod -R 777 .cache/modules
# Copy requirements first to leverage Docker cache
COPY requirements.txt .
# Install dependencies including CPU-only PyTorch
RUN pip install --no-cache-dir -r requirements.txt \
&& pip install torch --index-url https://download.pytorch.org/whl/cpu
# Copy application code
COPY . .
# Expose port
EXPOSE 7860
# Run the application
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"] |