21 lines
521 B
Docker
21 lines
521 B
Docker
FROM python:3.11-slim
|
|
|
|
# Prevent Python from buffering stdout/stderr so logs appear immediately
|
|
ENV PYTHONUNBUFFERED=1
|
|
|
|
# Install system dependencies (none needed for asyncpg on slim)
|
|
|
|
WORKDIR /app
|
|
|
|
# Install Python dependencies first to leverage Docker layer caching
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
# Copy service source code only after dependencies
|
|
COPY . /app
|
|
|
|
EXPOSE 8000
|
|
|
|
# Use Uvicorn as the ASGI server
|
|
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
|