LearningnRunning's picture
chore: Remove models directory copy from Dockerfile to streamline build process
5033c67
raw
history blame contribute delete
983 Bytes
# Python 3.12 ๊ธฐ๋ฐ˜ ์ด๋ฏธ์ง€
FROM python:3.12-slim
# ์ž‘์—… ๋””๋ ‰ํ† ๋ฆฌ ์„ค์ •
WORKDIR /app
# ์‹œ์Šคํ…œ ์˜์กด์„ฑ ์„ค์น˜
RUN apt-get update && apt-get install -y \
gcc \
postgresql-client \
curl \
&& rm -rf /var/lib/apt/lists/*
# ํ™˜๊ฒฝ ๋ณ€์ˆ˜ ์„ค์ •
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1
# uv ์„ค์น˜ (๋น ๋ฅธ Python ํŒจํ‚ค์ง€ ๊ด€๋ฆฌ์ž)
RUN pip install --no-cache-dir uv
# requirements.txt ๋ณต์‚ฌ ๋ฐ ์„ค์น˜
COPY requirements.txt ./
RUN uv pip install --system -r requirements.txt
# ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ์ฝ”๋“œ ๋ณต์‚ฌ
COPY config/ ./config/
COPY services/ ./services/
COPY data/ ./data/
COPY app.py init_db.py ./
# ํฌํŠธ ๋…ธ์ถœ (Hugging Face Space๋Š” 7860 ํฌํŠธ ์‚ฌ์šฉ)
EXPOSE 7860
# ํ—ฌ์Šค์ฒดํฌ ์ถ”๊ฐ€
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
CMD curl -f http://localhost:7860/ || exit 1
# ์‹œ์ž‘ ์Šคํฌ๋ฆฝํŠธ (Hugging Face Space๋Š” ์ž๋™์œผ๋กœ ํ™˜๊ฒฝ ๋ณ€์ˆ˜๋ฅผ ์ฃผ์ž…ํ•จ)
CMD ["python", "app.py"]