lily_fast_api / Dockerfile.local
gbrabbit's picture
Fresh start for HF Spaces deployment
526927a
Raw
History Blame Contribute Delete
1.42 kB
# ๋กœ์ปฌ ๊ฐœ๋ฐœ์šฉ Lily LLM API Server Dockerfile
FROM python:3.11-slim
# ๋กœ์ปฌ ํ™˜๊ฒฝ ๋ณ€์ˆ˜ ์„ค์ •
ENV IS_LOCAL=true
ENV ENVIRONMENT=local
ENV DOCKER_ENV=local
ENV PYTHONPATH=/app
ENV PYTHONUNBUFFERED=1
ENV TOKENIZERS_PARALLELISM=false
# ์ž‘์—… ๋””๋ ‰ํ† ๋ฆฌ ์„ค์ •
WORKDIR /app
# ์‹œ์Šคํ…œ ์˜์กด์„ฑ ์„ค์น˜
RUN apt-get update && apt-get install -y \
build-essential \
curl \
git \
wget \
ffmpeg \
libsm6 \
libxext6 \
libfontconfig1 \
libxrender1 \
libgl1-mesa-glx \
&& rm -rf /var/lib/apt/lists/*
# Python ์˜์กด์„ฑ ์„ค์น˜
COPY requirements_full.txt requirements.txt
RUN pip install --no-cache-dir --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt
# NLTK ๋ฐ์ดํ„ฐ ๋‹ค์šด๋กœ๋“œ
RUN python -c "import nltk; nltk.download('punkt'); nltk.download('punkt_tab'); nltk.download('averaged_perceptron_tagger'); nltk.download('maxent_ne_chunker'); nltk.download('words'); nltk.download('stopwords')"
# ํ•„์š”ํ•œ ๋””๋ ‰ํ† ๋ฆฌ ์ƒ์„ฑ
RUN mkdir -p /app/data /app/logs /app/models /app/uploads /app/vector_stores /app/temp
# ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ์ฝ”๋“œ ๋ณต์‚ฌ
COPY . .
# ๊ถŒํ•œ ์„ค์ •
RUN chmod +x /app/*.py
# ํฌํŠธ ๋…ธ์ถœ (๋กœ์ปฌ ๊ฐœ๋ฐœ์šฉ)
EXPOSE 8001
# ํ—ฌ์Šค์ฒดํฌ
HEALTHCHECK --interval=30s --timeout=30s --start-period=60s --retries=3 \
CMD curl -f http://localhost:8001/health || exit 1
# ๋กœ์ปฌ ๊ฐœ๋ฐœ์šฉ ์•ฑ ์‹œ์ž‘์ 
CMD ["python", "app_local.py"]