IDS75912/CTAIAnimalClassifierFastApi
0
1# --- Builder Stage ---2# Use a full Python image to build dependencies3FROM python:3.12 as builder4 5WORKDIR /app6 7# Install dependencies into a virtual environment8RUN python -m venv /opt/venv9ENV PATH="/opt/venv/bin:$PATH"10 11COPY requirements.txt .12RUN pip install --no-cache-dir -r requirements.txt13 14# --- Runner Stage ---15# Use a slim image for the final application16FROM python:3.12-slim17 18WORKDIR /app19 20# Copy the virtual environment from the builder stage21COPY --from=builder /opt/venv /opt/venv22 23# Copy the application code24COPY . .25 26# Set the path to use the virtual environment27ENV PATH="/opt/venv/bin:$PATH"28 29# Expose the port and run the app30EXPOSE 800031CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]32 33 34 