lily_fast_api / Dockerfile.local
gbrabbit's picture
Fresh start for HF Spaces deployment
526927a
raw
history blame
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"]