Skip to content

Commit 83751f7

Browse files
committed
torchcpu3
1 parent 577c773 commit 83751f7

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

Dockerfile

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,23 @@
22
FROM python:3.10-slim
33

44
# 작업 디렉토리 설정
5-
WORKDIR /app
6-
# 시스템 의존성
7-
RUN apt-get update && apt-get install -y \
8-
gcc \
9-
&& rm -rf /var/lib/apt/lists/*
105

11-
# pyproject.toml 복사 및 의존성 설치
6+
WORKDIR /app
7+
# 1. 파일 복사
128
COPY pyproject.toml .
9+
10+
# 2. 필수 라이브러리 및 torch CPU 설치
1311
RUN pip install --no-cache-dir --upgrade pip && \
1412
pip install --no-cache-dir torch==2.1.0 --index-url https://download.pytorch.org/whl/cpu
1513

16-
# 3. 나머지 종속성 설치 (이때 pyproject.toml의 torch는 이미 설치되어 패스됨)
14+
# 3. [핵심] hanspell 설치 (GitHub에서 직접 가져오기)
15+
# py-hanspell이 git 설치가 필요한 경우를 대비해 git도 설치해줍니다.
16+
RUN apt-get update && apt-get install -y git && \
17+
pip install git+https://github.com/ssut/py-hanspell.git
18+
19+
# 4. 나머지 종속성 설치
1720
RUN pip install --no-cache-dir .
1821

19-
# 애플리케이션 코드 복사
22+
# 5. 소스 코드 복사 및 실행
2023
COPY . .
21-
22-
EXPOSE 8000
23-
24-
# uvicorn으로 실행
25-
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
24+
CMD ["python3", "-m", "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]

0 commit comments

Comments
 (0)