Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Git
.git
.gitignore
.gitattributes
.gitmodules

# Documentation
doc/
*.md
!README.md

# IDE and editor files
.idea/
.vscode/
*.swp
*.swo
*~

# Python cache
__pycache__/
*.py[cod]
*$py.class
*.so
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg

# Virtual environments
venv/
ENV/
env/

# Test and coverage
.coverage
.tox/
.nox/
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# CI/CD
.travis.yml
.github/

# Linting configs
.cardboardlint.yml
.coveragerc
.pycodestylerc
.pydocstylerc
.pylintrc

# Docker (avoid recursion)
Dockerfile
docker-compose.yml
.dockerignore
55 changes: 55 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# ChemTools Docker Configuration
# Based on miniconda2 for Python 2.7 + conda support
# Addresses GitHub Issue #42: Docker Update

FROM continuumio/miniconda2:latest

LABEL maintainer="ChemTools Dev Team <horton.chemtools@gmail.com>"
LABEL description="ChemTools - Interpretive Chemical Tools for Quantum Chemistry"
LABEL version="2.0"

# Set environment variables
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1

# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
git \
git-lfs \
&& rm -rf /var/lib/apt/lists/* \
&& git lfs install

# Configure conda channels
RUN conda config --set always_yes yes && \
conda config --add channels theochem && \
conda config --add channels conda-forge

# Create conda environment and install dependencies
RUN conda create -n chemtools python=2.7 && \
/bin/bash -c "source activate chemtools && \
conda install -c theochem horton=2.1.0 && \
conda clean -afy"

# Set up the conda environment to activate by default
ENV PATH="/opt/conda/envs/chemtools/bin:$PATH"
ENV CONDA_DEFAULT_ENV=chemtools

# Set working directory
WORKDIR /chemtools

# Copy project files
COPY . .

# Install ChemTools
RUN /bin/bash -c "source activate chemtools && pip install -e ."

# Create a non-root user for security
RUN useradd -m -s /bin/bash chemtools_user && \
chown -R chemtools_user:chemtools_user /chemtools

USER chemtools_user

# Default command
ENTRYPOINT ["/bin/bash", "-c", "source activate chemtools && exec \"$@\"", "--"]
CMD ["chemtools", "--help"]
37 changes: 37 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,43 @@ To run tests:
nosetests -v chemtools
```

Docker
------

ChemTools can be run using Docker, which simplifies dependency management.

### Building the Image

```bash
docker build -t chemtools:latest .
```

### Running ChemTools

```bash
# Show help
docker run --rm chemtools:latest chemtools --help

# Run with mounted data directory
docker run --rm -v $(pwd)/data:/chemtools/data chemtools:latest chemtools <command>

# Interactive shell
docker run --rm -it chemtools:latest /bin/bash
```

### Using Docker Compose

```bash
# Build and run
docker-compose up --build

# Run tests
docker-compose run chemtools-test

# Run a specific command
docker-compose run chemtools chemtools --help
```

Development
-----------
New contributors of all programming levels are welcome to join us. You can follow
Expand Down
33 changes: 33 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# ChemTools Docker Compose Configuration
# Usage: docker-compose up --build
# Or run commands: docker-compose run chemtools <command>

version: '3.8'

services:
chemtools:
build:
context: .
dockerfile: Dockerfile
image: chemtools:latest
container_name: chemtools
volumes:
# Mount local data directory for input/output files
- ./data:/chemtools/data
# Mount examples for easy access
- ./examples:/chemtools/examples:ro
working_dir: /chemtools/data
# Override entrypoint for interactive shell access
stdin_open: true
tty: true

# Service for running tests
chemtools-test:
build:
context: .
dockerfile: Dockerfile
image: chemtools:latest
container_name: chemtools-test
command: [ "nosetests", "-v", "chemtools" ]
volumes:
- ./chemtools:/chemtools/chemtools:ro