-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (27 loc) · 815 Bytes
/
Dockerfile
File metadata and controls
35 lines (27 loc) · 815 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# Stage 1: 빌드 & 의존성 설치
FROM python:3.11-slim AS builder
WORKDIR /app
COPY requirements.txt .
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
gcc \
libpq-dev \
libffi-dev \
curl \
poppler-utils \
&& pip install --upgrade pip setuptools wheel cython build \
&& pip install numpy \
&& pip install --no-cache-dir -r requirements.txt --extra-index-url https://download.pytorch.org/whl/cpu \
&& apt-get purge -y --auto-remove \
build-essential \
gcc \
libpq-dev \
libffi-dev \
&& rm -rf /var/lib/apt/lists/*
# Stage 2: 실행 환경용 경량 이미지
FROM python:3.11-slim
WORKDIR /app
COPY --from=builder /usr/local /usr/local
COPY . .
EXPOSE 8000
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]