FROM python:3.11-slim ENV PYTHONDONTWRITEBYTECODE=1 \ PYTHONUNBUFFERED=1 \ PIP_NO_CACHE_DIR=1 WORKDIR /app # psycopg2-binary는 빌드툴 없이도 설치 가능하지만, 일부 환경에서 libpq가 # 필요할 수 있어 런타임 의존성만 가볍게 설치합니다. RUN apt-get update \ && apt-get install -y --no-install-recommends curl ca-certificates \ && rm -rf /var/lib/apt/lists/* COPY requirements.txt ./ RUN pip install --upgrade pip && pip install -r requirements.txt COPY app ./app COPY static ./static EXPOSE 8000 HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=3 \ CMD curl -fsS http://localhost:8000/health/db || exit 1 CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000", "--proxy-headers"]