# 로컬 개발용 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"]