39 lines
989 B
Docker
39 lines
989 B
Docker
FROM python:3.10-slim
|
|
|
|
WORKDIR /app
|
|
|
|
# Install system dependencies including LibreOffice
|
|
RUN apt-get update && apt-get install -y \
|
|
build-essential \
|
|
libreoffice \
|
|
libreoffice-writer \
|
|
libreoffice-calc \
|
|
libreoffice-impress \
|
|
wget \
|
|
curl \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Copy requirements and install Python packages first
|
|
COPY requirements.txt .
|
|
RUN pip install --upgrade pip
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
# Install fairy-doc after numpy and opencv are installed
|
|
RUN pip install --no-cache-dir "fairy-doc[cpu]"
|
|
|
|
# Copy the application code
|
|
COPY app/ ./app/
|
|
|
|
# Create storage directories
|
|
RUN mkdir -p storage/uploads storage/processed
|
|
|
|
# Expose the port the app runs on
|
|
EXPOSE 8000
|
|
|
|
# Health check
|
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
|
|
CMD curl -f http://localhost:8000/health || exit 1
|
|
|
|
# Command to run the application
|
|
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
|