MOAI / Dockerfile
wenbemi
Update Dockerfile
c6a6e7c verified
raw
history blame
986 Bytes
# 1. 파이썬 버전을 3.11으둜 μ—…κ·Έλ ˆμ΄λ“œν•©λ‹ˆλ‹€. (TypeError ν•΄κ²°)
FROM python:3.11-slim
# 2. μ‹œμŠ€ν…œ νŒ¨ν‚€μ§€λ₯Ό μ„€μΉ˜ν•©λ‹ˆλ‹€.
RUN apt-get update && apt-get install -y \
build-essential \
curl \
git \
git-lfs \
&& rm -rf /var/lib/apt/lists/*
# 3. μž‘μ—… 디렉터리λ₯Ό λ§Œλ“€κ³  μ΄λ™ν•©λ‹ˆλ‹€.
WORKDIR /app
# 4. Git LFSλ₯Ό ν™œμ„±ν™”ν•˜κ³ , ν˜„μž¬ ν΄λ”μ˜ λͺ¨λ“  νŒŒμΌμ„ λ³΅μ‚¬ν•©λ‹ˆλ‹€.
# COPY 이전에 git lfs install을 μ‹€ν–‰ν•˜λŠ” 것이 μ€‘μš”!
RUN git lfs install
COPY . .
# 5. Git LFSλ₯Ό 톡해 μ‹€μ œ λŒ€μš©λŸ‰ νŒŒμΌλ“€μ„ λ‹€μš΄λ‘œλ“œν•©λ‹ˆλ‹€.
RUN git lfs pull
# 6. requirements.txt에 λͺ…μ‹œλœ 파이썬 λΌμ΄λΈŒλŸ¬λ¦¬λ“€μ„ μ„€μΉ˜ν•©λ‹ˆλ‹€.
RUN pip install --no-cache-dir -r requirements.txt
# 7. 7860번 포트λ₯Ό 외뢀에 κ°œλ°©ν•©λ‹ˆλ‹€.
EXPOSE 7860
# 8. μ»¨ν…Œμ΄λ„ˆκ°€ μ‹œμž‘λ  λ•Œ streamlit 앱을 μ‹€ν–‰ν•©λ‹ˆλ‹€.
CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.fileWatcherType=none"]