apix/services/crawl4ai/Dockerfile
Khoa.vo 2a4bf8b58b
Some checks are pending
CI / build (18.x) (push) Waiting to run
CI / build (20.x) (push) Waiting to run
feat: updates before deployment
2026-01-06 13:26:11 +07:00

38 lines
1,014 B
Docker

# Meta AI Python Service
# Uses metaai-api library from https://github.com/mir-ashiq/metaai-api
FROM python:3.11-slim
WORKDIR /app
# Install system dependencies for requests-html (pyppeteer)
RUN apt-get update && apt-get install -y \
git \
chromium \
chromium-driver \
&& rm -rf /var/lib/apt/lists/*
# Set Chrome path for pyppeteer
ENV CHROMIUM_EXECUTABLE=/usr/bin/chromium
# Copy requirements first for caching
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Install metaai-api from GitHub (for latest updates)
RUN pip install --no-cache-dir git+https://github.com/mir-ashiq/metaai-api.git
# Copy application code
COPY app/ ./app/
# Create non-root user
RUN useradd -m -u 1000 appuser && chown -R appuser:appuser /app
USER appuser
EXPOSE 8000
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD curl -f http://localhost:8000/health || exit 1
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]