- Add COPY templates/ ./templates/ to Dockerfile - Fixes TemplateNotFound error for Flask HTML templates - Required for serving Jinja2 templates from FastAPI Co-Authored-By: Claude Sonnet 4.5 (1M context) <noreply@anthropic.com>
33 lines
781 B
Docker
33 lines
781 B
Docker
# FastAPI Backend Dockerfile
|
|
FROM python:3.11-slim
|
|
|
|
WORKDIR /app
|
|
|
|
# Install system dependencies
|
|
RUN apt-get update && apt-get install -y \
|
|
libimage-exiftool-perl \
|
|
tesseract-ocr \
|
|
tesseract-ocr-chi-sim \
|
|
tesseract-ocr-chi-tra \
|
|
tesseract-ocr-jpn \
|
|
tesseract-ocr-kor \
|
|
poppler-utils \
|
|
ffmpeg \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Copy requirements and install Python dependencies
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
# Copy application code
|
|
COPY app/ ./app/
|
|
COPY templates/ ./templates/
|
|
|
|
# Create directories for data persistence
|
|
RUN mkdir -p /app/uploads /app/data /app/output/templates
|
|
|
|
# Expose port
|
|
EXPOSE 8000
|
|
|
|
# Run the application
|
|
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
|