forked from All-in-one-move/AIM-14-AI-VLM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
51 lines (39 loc) · 1.1 KB
/
Dockerfile
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Stage 1: Build dependencies
FROM python:3.12-slim AS builder
WORKDIR /app
# 시스템 종속성 설치
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
libffi-dev \
libssl-dev \
ffmpeg \
libsndfile1 \
libgl1-mesa-glx \
libglib2.0-0 \
libjpeg-dev \
zlib1g-dev \
libcairo2 \
libpango-1.0-0 \
libpangocairo-1.0-0 \
&& rm -rf /var/lib/apt/lists/*
# Python 종속성 설치
COPY requirements.txt .
RUN pip install --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt
# Stage 2: Runtime stage
FROM python:3.12-slim
WORKDIR /app
# OpenCV 런타임 의존성 및 ffmpeg 설치
RUN apt-get update && apt-get install -y --no-install-recommends \
libgl1-mesa-glx \
libglib2.0-0 \
ffmpeg \
&& rm -rf /var/lib/apt/lists/*
# 빌드된 Python 패키지 복사
COPY --from=builder /usr/local /usr/local
# /app/logs 디렉토리 생성
RUN mkdir -p /app/logs
COPY . .
ENV PYTHONPATH=/app
EXPOSE 8000
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000", "--reload", "--log-config", "logging_config.json"]