diff --git a/.env.example b/.env.example index e867fcb..aff166c 100644 --- a/.env.example +++ b/.env.example @@ -13,6 +13,16 @@ TWILIO_TO_NUMBER=+0987654321 # Optional: Custom conda installation (for academic/lab environments) # Example: CONDA_PREFIX=/vol/biomedic3/username/miniconda3 CONDA_PREFIX= + # Optional: Additional conda directories (space-separated list) +# Directories are mounted to the same path inside the container +# Automatic detection: +# - Paths with "*env*" are added to CONDA_ENVS_DIRS (for environments) +# - Paths with "*pkg*" are added to CONDA_PKGS_DIRS (for package cache) # Example: CONDA_EXTRA_DIRS="/vol/biomedic3/username/.conda/envs /vol/biomedic3/username/conda_envs /vol/biomedic3/username/.conda/pkgs /vol/biomedic3/username/conda_pkgs /homes/username/.conda/envs" -CONDA_EXTRA_DIRS= \ No newline at end of file +CONDA_EXTRA_DIRS= + +# Optional: System packages to install in Docker container (space-separated) +# Common scientific packages: libopenslide0 libgdal-dev libproj-dev libopencv-dev +# Example: SYSTEM_PACKAGES="libopenslide0 libgdal-dev" +SYSTEM_PACKAGES= \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 22b6341..a28ebca 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,6 +12,17 @@ RUN apt-get update && apt-get install -y \ sudo \ && rm -rf /var/lib/apt/lists/* +# Install additional system packages if specified +ARG SYSTEM_PACKAGES="" +RUN if [ -n "$SYSTEM_PACKAGES" ]; then \ + echo "Installing additional system packages: $SYSTEM_PACKAGES" && \ + apt-get update && \ + apt-get install -y $SYSTEM_PACKAGES && \ + rm -rf /var/lib/apt/lists/*; \ +else \ + echo "No additional system packages specified"; \ +fi + # Create a non-root user with matching host UID/GID ARG USER_UID=1000 ARG USER_GID=1000 diff --git a/README.md b/README.md index df6c902..1e587ca 100644 --- a/README.md +++ b/README.md @@ -113,6 +113,12 @@ This workflow gives you: - Configurable via MCP integration - Optional - works without if Twilio not configured +### 🐍 Conda Integration +- Supports custom conda installations (ideal for academic/lab environments) +- Mounts conda directories to preserve original paths and configurations +- Automatic environment variable configuration for seamless conda usage +- Works with environments and package caches in non-standard locations + ### 🗂️ Context Persistence - Maintains scratchpad.md files for project memory - Persistent across container sessions @@ -181,7 +187,49 @@ claude-docker Rebuild when you: - Update your .env file with new credentials - Update the Claude Docker repository -- Want to refresh the authentication files + +### Conda Configuration + +For custom conda installations (common in academic/lab environments), add these to your `.env` file: + +```bash +# Main conda installation +CONDA_PREFIX=/vol/biomedic3/username/miniconda3 + +# Additional conda directories (space-separated) +CONDA_EXTRA_DIRS="/vol/biomedic3/username/.conda/envs /vol/biomedic3/username/conda_envs /vol/biomedic3/username/.conda/pkgs /vol/biomedic3/username/conda_pkgs" +``` + +**How it works:** +- `CONDA_PREFIX`: Mounts your conda installation to the same path in container +- `CONDA_EXTRA_DIRS`: Mounts additional directories and automatically configures conda + +**Automatic Detection:** +- Paths containing `*env*` → Added to `CONDA_ENVS_DIRS` (conda environment search) +- Paths containing `*pkg*` → Added to `CONDA_PKGS_DIRS` (package cache search) + +**Result:** All your conda environments and packages work exactly as they do on your host system. + +### System Package Installation + +For scientific computing packages that require system libraries, add them to your `.env` file: + +```bash +# Install OpenSlide for medical imaging +SYSTEM_PACKAGES="libopenslide0" + +# Install multiple packages (space-separated) +SYSTEM_PACKAGES="libopenslide0 libgdal-dev libproj-dev libopencv-dev" +``` + +**Common packages:** +- `libopenslide0` - OpenSlide for whole slide imaging +- `libgdal-dev` - GDAL for geospatial data +- `libproj-dev` - PROJ for cartographic projections +- `libopencv-dev` - OpenCV for computer vision +- `libfftw3-dev` - FFTW for fast Fourier transforms + +**Note:** Adding system packages requires rebuilding the Docker image (`docker rmi claude-docker:latest`). ## Requirements