BrainIAC-Brainage-V0 / Dockerfile
Divytak's picture
Update Dockerfile
895e6ba verified
# 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"]