File size: 1,462 Bytes
f5288df
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
895e6ba
 
f5288df
895e6ba
 
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
# Use an official Python runtime as a parent image
FROM python:3.10-slim

# Set the working directory in the container
WORKDIR /app

# Install necessary system dependencies
RUN apt-get update && \
    apt-get install -y --no-install-recommends \
    unzip \
    git \
    # Add potential ITK/build dependencies (might need adjustment)
    build-essential \
    cmake \
    libgl1 \
    libglib2.0-0 \
    # libitk5-dev # Removed: Rely on pip install of itk-elastix
    && \
    rm -rf /var/lib/apt/lists/*

# Copy the requirements file first to leverage Docker cache
COPY requirements.txt .

# Install Python packages specified in requirements.txt
# Using --no-cache-dir can reduce image size
RUN pip install --no-cache-dir -r requirements.txt

# --- HD-BET is now copied locally via src/BrainIAC ---

# Copy the rest of the application code (including local HD_BET)
COPY src/BrainIAC /app/BrainIAC

# Copy static files (like images)
COPY src/BrainIAC/static /app/BrainIAC/static

# Copy the MNI templates and parameter files
COPY src/BrainIAC/golden_image /app/BrainIAC/golden_image

# Copy the HD-BET models
COPY src/BrainIAC/hdbet_model /app/BrainIAC/hdbet_model

# Copy the model checkpoint
COPY src/BrainIAC/checkpoints/brainage_model_latest.pt /app/BrainIAC/checkpoints/brainage_model_latest.pt

# Make port 7860 available (for Gradio)
EXPOSE 7860

# Run app_gradio.py when the container launches using python
CMD ["python", "/app/BrainIAC/app_gradio.py"]