-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (29 loc) · 1.12 KB
/
Dockerfile
File metadata and controls
38 lines (29 loc) · 1.12 KB
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
# 1. 권장 베이스: CUDA 포함 PyTorch 런타임
FROM pytorch/pytorch:2.3.1-cuda12.1-cudnn8-runtime
# OpenCV/Ultralytics가 필요로 하는 OS 라이브러리
RUN apt-get update && apt-get install -y --no-install-recommends \
libgl1 \
libglib2.0-0 \
libsm6 \
libxext6 \
libxrender1 \
&& rm -rf /var/lib/apt/lists/*
# HF 캐시 + PyTorch 메모리 튜닝(선택)
ENV HF_HOME=/models/hf-cache \
HUGGINGFACE_HUB_CACHE=/models/hf-cache \
PYTORCH_CUDA_ALLOC_CONF=max_split_size_mb:128
# 2. 작업 디렉토리 생성
WORKDIR /app
# 3. 의존성만 먼저 복사 → 캐시 최대 활용
COPY everTale/requirements.txt ./requirements.txt
RUN pip install --no-cache-dir --upgrade pip \
&& pip install --no-cache-dir -r /app/requirements.txt
# 모델 파일을 이미지에 포함
COPY models/my_yolo_model_v2.pt /models/my_yolo_model_v2.pt
ENV YOLO_MODEL_PATH=/models/my_yolo_model_v2.pt
# 4. 전체 코드 복사
COPY . /app
# 5. 컨테이너가 열 포트 설정
EXPOSE 8000
# 6. FastAPI 실행 (앱 위치가 app/main.py)
CMD ["uvicorn", "everTale.app.main:app", "--host", "0.0.0.0", "--port", "8000"]