| |
| |
| |
| |
| |
| |
| |
|
|
| FROM python:3.11-slim |
|
|
| WORKDIR /app |
|
|
| |
| RUN apt-get update && apt-get install -y \ |
| wget \ |
| gnupg \ |
| poppler-utils \ |
| tesseract-ocr \ |
| tesseract-ocr-eng \ |
| libglib2.0-0 \ |
| libnss3 \ |
| libnspr4 \ |
| libdbus-1-3 \ |
| libatk1.0-0 \ |
| libatk-bridge2.0-0 \ |
| libcups2 \ |
| libdrm2 \ |
| libxkbcommon0 \ |
| libxcomposite1 \ |
| libxdamage1 \ |
| libxfixes3 \ |
| libxrandr2 \ |
| libgbm1 \ |
| libasound2 \ |
| libpango-1.0-0 \ |
| libcairo2 \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| |
| COPY api/requirements.txt ./api/requirements.txt |
| RUN pip install --no-cache-dir -r api/requirements.txt |
|
|
| |
| COPY docgenie/__init__.py ./docgenie/__init__.py |
| COPY docgenie/logging.py ./docgenie/logging.py |
| COPY docgenie/generation ./docgenie/generation |
| COPY data/prompt_templates ./data/prompt_templates |
| COPY data/visual_element_prefabs ./data/visual_element_prefabs |
|
|
| |
| COPY api ./api |
|
|
| |
| COPY start.sh ./start.sh |
| RUN chmod +x start.sh |
|
|
| |
| RUN find /usr/local/lib/python3.11/site-packages -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true && \ |
| find /usr/local/lib/python3.11/site-packages -name "*.pyc" -delete |
|
|
| |
| |
| |
| RUN useradd -m -u 1000 user |
|
|
| |
| RUN playwright install-deps chromium |
|
|
| |
| RUN mkdir -p /tmp/docgenie /home/user/.cache/playwright && \ |
| chown -R user:user /app /tmp/docgenie /home/user |
|
|
| |
| USER user |
|
|
| |
| ENV HOME=/home/user \ |
| PATH=/home/user/.local/bin:$PATH \ |
| PYTHONUNBUFFERED=1 \ |
| PYTHONPATH=/app \ |
| PORT=7860 \ |
| PLAYWRIGHT_BROWSERS_PATH=/home/user/.cache/playwright |
|
|
| |
| |
| RUN playwright install chromium |
|
|
| |
| EXPOSE 7860 |
|
|
| |
| HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \ |
| CMD python -c "import requests; requests.get('http://localhost:7860/health')" |
|
|
| |
| CMD ["./start.sh"] |
|
|