File size: 1,333 Bytes
a963d65
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
46
47
48
49
50
51
52
53
# FhirFlame - Hugging Face Spaces Deployment
# Optimized for L4 GPU with healthcare AI capabilities
FROM python:3.11-slim

# Set working directory
WORKDIR /app

# Install system dependencies for medical document processing
RUN apt-get update && apt-get install -y \
    curl \
    build-essential \
    poppler-utils \
    git \
    && rm -rf /var/lib/apt/lists/*

# Copy requirements first for better caching
COPY requirements.txt .

# Install Python dependencies optimized for HF Spaces
RUN pip install --no-cache-dir --upgrade pip && \
    pip install --no-cache-dir -r requirements.txt

# Copy core application files
COPY src/ ./src/
COPY app.py .
COPY frontend_ui.py .
COPY fhirflame_logo.svg .
COPY fhirflame_logo_450x150.svg .

# Copy environment configuration (HF Spaces will override)
COPY .env* ./

# Create necessary directories
RUN mkdir -p logs test_results

# Set Python path for proper imports
ENV PYTHONPATH=/app
ENV GRADIO_SERVER_NAME=0.0.0.0
ENV GRADIO_SERVER_PORT=7860

# HF Spaces specific environment
ENV HF_SPACES_DEPLOYMENT=true
ENV DEPLOYMENT_TARGET=hf_spaces

# Expose Gradio port for HF Spaces
EXPOSE 7860

# Health check for HF Spaces
HEALTHCHECK --interval=30s --timeout=10s --start-period=10s --retries=3 \
    CMD curl -f http://localhost:7860 || exit 1

# Start the application
CMD ["python", "app.py"]