FROM python:3.10-slim | |
# Prevent Python from writing .pyc files and using buffered output | |
ENV PYTHONDONTWRITEBYTECODE=1 | |
ENV PYTHONUNBUFFERED=1 | |
# Set working directory | |
WORKDIR /app | |
# Install dependencies | |
COPY requirements.txt . | |
RUN pip install --upgrade pip && pip install -r requirements.txt | |
# Copy source code | |
COPY main.py . | |
# Run the app with Uvicorn | |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"] | |