forked from naman-ranka/HEAL_AI
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
45 lines (33 loc) · 1.09 KB
/
Dockerfile
File metadata and controls
45 lines (33 loc) · 1.09 KB
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
35
36
37
38
39
40
41
42
43
44
45
# Multi-stage Docker build for HEAL.AI
# Stage 1: Build Frontend
FROM node:18-alpine as frontend-builder
WORKDIR /app/frontend-clean
COPY frontend-clean/package*.json ./
RUN npm ci || npm install
COPY frontend-clean/ ./
RUN npm run build
# Stage 2: Python Backend with Frontend
FROM python:3.11-slim
# Install system dependencies
RUN apt-get update && apt-get install -y \
tesseract-ocr \
tesseract-ocr-eng \
curl \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Copy backend requirements and install Python dependencies
COPY backend/requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
# Copy backend code
COPY backend/ ./
# Copy built frontend from previous stage
COPY --from=frontend-builder /app/frontend-clean/dist ./static
# Create uploads directory
RUN mkdir -p uploads
# Expose port (Railway will override with PORT env var)
EXPOSE 8000
# Health check (use PORT env var, fallback to 8000)
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD curl -f http://localhost:${PORT:-8000}/health || exit 1
# Start command
CMD ["python", "main.py"]