-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
57 lines (46 loc) · 1.84 KB
/
Copy pathDockerfile
File metadata and controls
57 lines (46 loc) · 1.84 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
46
47
48
49
50
51
52
53
54
55
56
57
# 1. 베이스 이미지 설정
FROM ubuntu:22.04
# 2. 시스템 환경 변수 설정
ENV DEBIAN_FRONTEND=noninteractive
# 3. 기본 의존성 설치
# - libgl1-mesa-glx: OpenCV 실행에 필요한 그래픽 라이브러리 (libGL.so.1 오류 해결)
# - libglib2.0-0: GObject 라이브러리로, 일부 그래픽/UI 관련 라이브러리의 의존성 (libgthread-2.0.so.0 오류 해결)
RUN apt-get update && apt-get install -y --no-install-recommends \
wget \
gnupg2 \
ca-certificates \
python3.10 \
python3-pip \
python3.10-venv \
libgl1-mesa-glx \
libglib2.0-0 \
&& rm -rf /var/lib/apt/lists/*
# 4. ROCm 저장소 추가 및 우선순위 설정
RUN wget -qO - https://repo.radeon.com/rocm/rocm.gpg.key | apt-key add - && \
echo "deb [arch=amd64] https://repo.radeon.com/rocm/apt/6.4.1/ jammy main" | tee /etc/apt/sources.list.d/rocm.list && \
{ \
echo "Package: *"; \
echo "Pin: release o=repo.radeon.com"; \
echo "Pin-Priority: 1001"; \
} | tee /etc/apt/preferences.d/rocm-pin
# 5. ROCm 런타임 설치
RUN apt-get update && apt-get install -y --no-install-recommends \
rocm-hip-runtime \
rocm-smi-lib \
rocminfo && \
rm -rf /var/lib/apt/lists/*
# 6. pip 업데이트 및 Python 대체 설정
RUN python3.10 -m pip install --upgrade pip && \
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1
# 7. PyTorch for ROCm 6.4 설치
RUN pip3 install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/rocm6.4
# 8. 작업 디렉토리 설정
WORKDIR /workspace
# 9. 프로젝트 소스 코드 복사
COPY . .
# 10. 파이썬 의존성 라이브러리 설치
RUN pip3 install --no-cache-dir -r requirements.txt
# 11. 포트 노출
EXPOSE 8501
# 12. 컨테이너 실행 명령어 설정
CMD ["streamlit", "run", "app.py"]