File size: 913 Bytes
5752a28
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# --- Build Frontend ---
FROM node:20-alpine AS frontend-builder
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build

# --- Build Backend & Run ---
FROM python:3.11-slim
WORKDIR /app

# Install system dependencies including tesseract-ocr
RUN apt-get update && apt-get install -y --no-install-recommends \

    tesseract-ocr \
    libtesseract-dev \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*

# Install Python requirements
COPY ai-backend/requirements.txt ./ai-backend/requirements.txt
RUN pip install --no-cache-dir -r ai-backend/requirements.txt

# Copy backend files and built frontend
COPY ai-backend/ ./ai-backend/
COPY --from=frontend-builder /app/dist ./dist

# Expose port 8000
EXPOSE 8000

# Set entry point using gunicorn for production reliability
WORKDIR /app/ai-backend
CMD ["gunicorn", "--bind", "0.0.0.0:8000", "server:app"]