FROM python:3.10-slim | |
# Set working directory | |
WORKDIR /app | |
# Install git and build tools | |
RUN apt-get update && \ | |
apt-get install -y git build-essential && \ | |
apt-get clean | |
# Install Python dependencies | |
COPY requirements.txt . | |
# Create venv and install dependencies | |
RUN python -m venv venv | |
ENV PATH="/app/venv/bin:$PATH" | |
RUN pip install --upgrade pip && \ | |
pip install --no-cache-dir -r requirements.txt | |
# Copy application code | |
COPY app.py . | |
# Start the app | |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] | |