Dockerfile 1.2 KB

1234567891011121314151617181920212223242526272829
  1. # ─────────────────────────────────────────────────────────────────────────────
  2. # PMDI Backend — FastAPI / Python 3.11
  3. # ─────────────────────────────────────────────────────────────────────────────
  4. FROM python:3.11-slim AS base
  5. # Prevent Python from writing .pyc files and buffer stdout/stderr
  6. ENV PYTHONDONTWRITEBYTECODE=1 \
  7. PYTHONUNBUFFERED=1
  8. WORKDIR /app
  9. # Install OS-level deps needed by psycopg2-binary and argon2-cffi
  10. RUN apt-get update \
  11. && apt-get install -y --no-install-recommends \
  12. gcc \
  13. libpq-dev \
  14. && rm -rf /var/lib/apt/lists/*
  15. # Install Python dependencies first (layer cache friendly)
  16. COPY requirements.txt ./
  17. RUN pip install --no-cache-dir --upgrade pip \
  18. && pip install --no-cache-dir -r requirements.txt
  19. # Copy application source
  20. COPY app/ ./app/
  21. EXPOSE 8000
  22. CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000", "--log-level", "info"]