document / Dockerfile
aiaiteam's picture
fix: HWP 읽기 — LibreOffice 제거, olefile 순수 Python 파서로 교체
02ba824
Raw
History Blame Contribute Delete
971 Bytes
FROM python:3.11-slim
WORKDIR /code
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# HF_HOME을 먼저 설정 → snapshot_download가 올바른 위치에 저장
ENV HF_HOME=/code/cache \
TRANSFORMERS_CACHE=/code/cache \
PORT=7860
# 빌드 시점에 모델 다운로드 (이 레이어는 캐시됨 — requirements.txt/Dockerfile 변경 시만 재실행)
# 코드(app.py, index.html 등)만 바꾸면 이 레이어는 그대로 재사용됨
RUN python -c "\
from huggingface_hub import snapshot_download; \
snapshot_download( \
'onnx-community/EXAONE-3.5-2.4B-Instruct', \
allow_patterns=[ \
'config.json', \
'generation_config.json', \
'tokenizer.json', \
'tokenizer_config.json', \
'special_tokens_map.json', \
'onnx/model_q4.onnx', \
'onnx/model_q4.onnx_data', \
] \
)"
COPY . .
EXPOSE 7860
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]