25 lines
798 B
Docker
25 lines
798 B
Docker
FROM python:3.10-slim
|
|
|
|
WORKDIR /app
|
|
|
|
# psycopg2 런타임 라이브러리 + curl (healthcheck 및 디버깅용)
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
libpq5 \
|
|
curl \
|
|
ca-certificates \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# 의존성 먼저 (캐시 활용)
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
# 소스 복사
|
|
COPY . .
|
|
|
|
EXPOSE 8002
|
|
|
|
# APP_ROOT_PATH 를 uvicorn --root-path 로 넘긴다 (shell form 필요 — 환경변수 확장).
|
|
# NPM 이 prefix 를 잘라 백엔드의 / 로 전달하므로 라우트는 prefix 없이 등록되고
|
|
# URL 생성 시에만 ASGI scope.root_path 가 prepend 된다.
|
|
CMD uvicorn main:app --host 0.0.0.0 --port 8002 --proxy-headers --forwarded-allow-ips=* --root-path "${APP_ROOT_PATH:-}"
|