| FROM python:3.11-slim | |
| WORKDIR /app | |
| # 1. ์์คํ ํจํค์ง ์ค์น | |
| RUN apt-get update && apt-get install -y \ | |
| build-essential \ | |
| git \ | |
| curl \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # 2. Python ์์กด์ฑ ์ค์น | |
| COPY requirements.txt . | |
| # ๐ฅ [์ฉ๋ ์ต์ ํ] ๋ฌด๊ฑฐ์ด PyTorch๋ฅผ CPU ์ ์ฉ์ผ๋ก ๋จผ์ ์ค์นํฉ๋๋ค. | |
| RUN pip install --no-cache-dir torch --index-url https://download.pytorch.org/whl/cpu | |
| # ๋๋จธ์ง ๋ผ์ด๋ธ๋ฌ๋ฆฌ ์ค์น (--no-cache-dir ์ ์ง) | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # 3. ์ ํ๋ฆฌ์ผ์ด์ ์ฝ๋ ๋ณต์ฌ | |
| COPY . . | |
| # ํ์ํ ๋๋ ํ ๋ฆฌ ์์ฑ | |
| RUN mkdir -p instance uploads vector_db knowledge_graphs logs static templates | |
| # 4. ํฌํธ ์ค์ ๋ฐ ํ๊ฒฝ ๋ณ์ | |
| EXPOSE 7860 | |
| ENV PORT=7860 | |
| ENV HOST=0.0.0.0 | |
| # 5. ์ ํ๋ฆฌ์ผ์ด์ ์คํ (app.py ์ง์ ์คํ) | |
| CMD ["python", "app.py"] | |