-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
45 lines (35 loc) · 1.41 KB
/
Copy pathDockerfile
File metadata and controls
45 lines (35 loc) · 1.41 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
39
40
41
42
43
44
45
# Python Slim 이미지 사용
FROM python:3.12-slim
# 타임존 설정
ENV TZ=Asia/Seoul
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# 작업 디렉토리 설정
WORKDIR /app
# 필수 시스템 패키지 설치 (PyTorch 및 기타 패키지 의존성)
RUN apt-get update && apt-get install -y --no-install-recommends \
wget \
build-essential \
libopenblas-dev \
libssl-dev \
&& rm -rf /var/lib/apt/lists/*
# pip, setuptools 최신화
RUN python -m pip install --upgrade pip setuptools wheel
# requirements.txt 복사
COPY requirements.txt /tmp/
# PyTorch와 Transformers를 먼저 설치 (시간 절약 및 캐싱)
#RUN pip install --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu && \
# pip install --no-cache-dir transformers
RUN pip install --no-cache-dir tensorflow==2.18.0
RUN pip install --no-cache-dir ultralytics==8.3.72
Run pip install --no-cache-dir scikit-learn==1.6.0
RUN pip uninstall -y opencv-python
RUN pip install --no-cache-dir opencv-python-headless
# 나머지 의존성 설치
RUN pip install --no-cache-dir -r /tmp/requirements.txt
# 애플리케이션 코드 복사
COPY . /app
# 포트 노출
EXPOSE 8082
# FastAPI 애플리케이션 실행
# CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8082", "--reload", "--log-level", "info"]