From 30a8247861f115518a531a18f3644d022ae036c5 Mon Sep 17 00:00:00 2001 From: Andrew Trepagnier Date: Sat, 13 Sep 2025 14:43:11 -0500 Subject: [PATCH] added dockerfile --- .dockerignore | 71 +++++ DOCKER_README.md | 279 ++++++++++++++++++ Dockerfile | 72 +++++ Makefile | 28 ++ docker-compose.yml | 61 ++++ docker-examples.sh | 127 ++++++++ docker.sh | 244 +++++++++++++++ test-docker.sh | 131 ++++++++ .../test_core.cpython-313-pytest-8.4.1.pyc | Bin 17892 -> 17887 bytes tmin/report_generator.py | 2 +- 10 files changed, 1014 insertions(+), 1 deletion(-) create mode 100644 .dockerignore create mode 100644 DOCKER_README.md create mode 100644 Dockerfile create mode 100644 docker-compose.yml create mode 100644 docker-examples.sh create mode 100755 docker.sh create mode 100755 test-docker.sh diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..b60a420 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,71 @@ +# Docker ignore file for TMIN package +# Exclude files that shouldn't be copied into Docker containers + +# Git +.git/ +.gitignore + +# Python +__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/ + +# IDE +.vscode/ +.idea/ +*.swp +*.swo +*~ + +# OS +.DS_Store +Thumbs.db + +# Testing and coverage +.pytest_cache/ +.coverage +coverage.xml +htmlcov/ +.tox/ + +# Documentation +docs/_build/ + +# Jupyter +.ipynb_checkpoints/ + +# Reports (generated files) +Reports/ +*.pdf +*.html + +# Temporary files +*.tmp +*.log + +# Docker +Dockerfile +docker-compose.yml +.dockerignore diff --git a/DOCKER_README.md b/DOCKER_README.md new file mode 100644 index 0000000..b2d5d38 --- /dev/null +++ b/DOCKER_README.md @@ -0,0 +1,279 @@ +# TMIN Docker Setup + +This directory contains Docker configuration for the TMIN package, allowing you to spin up fresh containers for testing and development. + +## Quick Start + +### 1. Build All Images +```bash +./docker.sh build +``` + +### 2. Run Tests in Fresh Container +```bash +./docker.sh test +``` + +### 3. Start Development Environment +```bash +./docker.sh dev +``` + +## Available Commands + +### Docker Management Script (`./docker.sh`) + +| Command | Description | +|---------|-------------| +| `build` | Build all Docker images (dev, test, prod) | +| `dev` | Start development container with volume mounting | +| `test` | Run tests in fresh container | +| `test-cov` | Run tests with coverage in fresh container | +| `lint` | Run linting in fresh container | +| `format` | Format code in fresh container | +| `clean` | Clean up Docker resources | +| `jupyter` | Start Jupyter notebook server | +| `shell` | Open shell in development container | +| `logs` | Show container logs | +| `stop` | Stop all containers | + +### Docker Compose Commands + +| Command | Description | +|---------|-------------| +| `docker-compose up -d tmin-dev` | Start development container | +| `docker-compose up -d tmin-test` | Start testing container | +| `docker-compose up -d tmin-prod` | Start production container | +| `docker-compose up -d tmin-jupyter` | Start Jupyter notebook | +| `docker-compose down` | Stop all containers | + +## Docker Images + +### 1. Development Image (`tmin-dev`) +- **Purpose**: Interactive development environment +- **Features**: + - All dependencies installed + - Volume mounting for live code changes + - Bash shell access + - Jupyter notebook support +- **Usage**: `./docker.sh dev` + +### 2. Testing Image (`tmin-test`) +- **Purpose**: Fresh testing environment +- **Features**: + - Clean environment for each test run + - All test dependencies + - Coverage reporting +- **Usage**: `./docker.sh test` + +### 3. Production Image (`tmin-prod`) +- **Purpose**: Production deployment +- **Features**: + - Minimal dependencies + - Non-root user + - Optimized for size +- **Usage**: `docker run tmin-prod` + +## Testing Workflows + +### Fresh Container Testing +```bash +# Run all tests in fresh container +./docker.sh test + +# Run tests with coverage +./docker.sh test-cov + +# Run specific test file +docker run --rm -v "$(pwd)":/app tmin-test python -m pytest tests/test_core_dev.py -v + +# Run tests with specific markers +docker run --rm -v "$(pwd)":/app tmin-test python -m pytest tests/ -m "not slow" -v +``` + +### Development Testing +```bash +# Start development environment +./docker.sh dev + +# Access container shell +./docker.sh shell + +# Inside container, run tests +python -m pytest tests/ -v + +# Run specific tests +python -m pytest tests/test_core_dev.py::TestPIPECoreDev::test_pipe_creation -v +``` + +## Code Quality Workflows + +### Linting +```bash +# Run linting in fresh container +./docker.sh lint + +# Or manually +docker run --rm -v "$(pwd)":/app tmin-dev flake8 tmin tests +docker run --rm -v "$(pwd)":/app tmin-dev mypy tmin --ignore-missing-imports +``` + +### Code Formatting +```bash +# Format code in fresh container +./docker.sh format + +# Or manually +docker run --rm -v "$(pwd)":/app tmin-dev black tmin tests +``` + +## Jupyter Notebook Development + +### Start Jupyter Server +```bash +./docker.sh jupyter +``` + +### Access Jupyter +1. Open browser to `http://localhost:8888` +2. Use token from container logs +3. Create notebooks in `tutorials/` directory + +### Stop Jupyter +```bash +docker-compose stop tmin-jupyter +``` + +## Multi-Python Version Testing + +### Test Multiple Python Versions +```bash +# Python 3.8 +docker build --build-arg PYTHON_VERSION=3.8 -t tmin-test-38 . + +# Python 3.9 +docker build --build-arg PYTHON_VERSION=3.9 -t tmin-test-39 . + +# Python 3.10 +docker build --build-arg PYTHON_VERSION=3.10 -t tmin-test-310 . + +# Python 3.11 +docker build --build-arg PYTHON_VERSION=3.11 -t tmin-test-311 . +``` + +## CI/CD Integration + +### GitHub Actions Example +```yaml +name: Docker Tests +on: [push, pull_request] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Build and test + run: | + docker build --target testing -t tmin-test . + docker run --rm tmin-test +``` + +## Troubleshooting + +### Common Issues + +1. **Permission Denied** + ```bash + chmod +x docker.sh + ``` + +2. **Port Already in Use** + ```bash + docker-compose down + ./docker.sh clean + ``` + +3. **Out of Disk Space** + ```bash + ./docker.sh clean + docker system prune -a + ``` + +4. **Build Failures** + ```bash + # Check Dockerfile syntax + docker build --target development -t tmin-dev . + + # Check dependencies + docker run --rm tmin-dev pip list + ``` + +### Debugging + +1. **Check Container Status** + ```bash + docker-compose ps + ``` + +2. **View Container Logs** + ```bash + ./docker.sh logs + ``` + +3. **Access Container Shell** + ```bash + ./docker.sh shell + ``` + +4. **Inspect Image** + ```bash + docker inspect tmin-dev + ``` + +## Best Practices + +### 1. Always Use Fresh Containers for Testing +- Ensures clean environment +- Catches dependency issues +- Mimics production environment + +### 2. Use Volume Mounting for Development +- Live code changes +- Faster iteration +- Debugging support + +### 3. Clean Up Regularly +```bash +./docker.sh clean +``` + +### 4. Test Multiple Python Versions +- Ensures compatibility +- Catches version-specific issues + +## File Structure + +``` +. +├── Dockerfile # Multi-stage Docker build +├── docker-compose.yml # Service definitions +├── .dockerignore # Files to exclude from build +├── docker.sh # Management script +└── README.md # This file +``` + +## Environment Variables + +| Variable | Description | Default | +|----------|-------------|---------| +| `PYTHONPATH` | Python path | `/app` | +| `PYTHONUNBUFFERED` | Unbuffered output | `1` | +| `PIP_NO_CACHE_DIR` | Disable pip cache | `1` | + +## Security Notes + +- All containers run as non-root user (`tmin`) +- Minimal base images used +- No unnecessary packages installed +- Volume mounts are read-only where possible diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..857e56f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,72 @@ +# TMIN Package Dockerfile +# Multi-stage build for development and production + +# Base image with Python 3.11 (latest stable) +FROM python:3.11-slim as base + +# Set environment variables +ENV PYTHONUNBUFFERED=1 \ + PYTHONDONTWRITEBYTECODE=1 \ + PIP_NO_CACHE_DIR=1 \ + PIP_DISABLE_PIP_VERSION_CHECK=1 + +# Install system dependencies +RUN apt-get update && apt-get install -y \ + build-essential \ + curl \ + git \ + && rm -rf /var/lib/apt/lists/* + +# Set working directory +WORKDIR /app + +# Development stage +FROM base as development + +# Copy package files +COPY pyproject.toml requirements.txt ./ +COPY tmin/ ./tmin/ +COPY tests/ ./tests/ +COPY Makefile run_tests.py ./ + +# Install development dependencies +RUN pip install --upgrade pip setuptools wheel +RUN pip install -e ".[dev]" + +# Create non-root user for security +RUN useradd --create-home --shell /bin/bash tmin +RUN chown -R tmin:tmin /app +USER tmin + +# Expose port for Jupyter if needed +EXPOSE 8888 + +# Default command for development +CMD ["bash"] + +# Testing stage +FROM development as testing + +# Run tests by default +CMD ["python", "-m", "pytest", "tests/", "-v", "--cov=tmin", "--cov-report=term-missing"] + +# Production stage +FROM base as production + +# Copy package files +COPY pyproject.toml requirements.txt ./ +COPY tmin/ ./tmin/ +COPY tests/ ./tests/ +COPY Makefile run_tests.py ./ + +# Install only production dependencies +RUN pip install --upgrade pip setuptools wheel +RUN pip install -e . + +# Create non-root user +RUN useradd --create-home --shell /bin/bash tmin +RUN chown -R tmin:tmin /app +USER tmin + +# Default command for production +CMD ["tmin", "--help"] diff --git a/Makefile b/Makefile index 1d0e79b..54437bf 100644 --- a/Makefile +++ b/Makefile @@ -41,3 +41,31 @@ build: ## Build package run-tests: ## Run tests using the test runner script python run_tests.py + +# Docker commands +docker-build: ## Build all Docker images + ./docker.sh build + +docker-test: ## Run tests in fresh Docker container + ./docker.sh test + +docker-test-cov: ## Run tests with coverage in fresh Docker container + ./docker.sh test-cov + +docker-dev: ## Start development Docker container + ./docker.sh dev + +docker-shell: ## Open shell in development Docker container + ./docker.sh shell + +docker-lint: ## Run linting in fresh Docker container + ./docker.sh lint + +docker-format: ## Format code in fresh Docker container + ./docker.sh format + +docker-clean: ## Clean up Docker resources + ./docker.sh clean + +docker-jupyter: ## Start Jupyter notebook in Docker + ./docker.sh jupyter diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..add6542 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,61 @@ +# Docker Compose for TMIN Package Development +version: '3.8' + +services: + # Development environment + tmin-dev: + build: + context: . + dockerfile: Dockerfile + target: development + container_name: tmin-dev + volumes: + - .:/app + - /app/htmlcov # Exclude coverage reports from volume mount + - /app/.pytest_cache # Exclude pytest cache + working_dir: /app + command: bash + stdin_open: true + tty: true + environment: + - PYTHONPATH=/app + + # Testing environment + tmin-test: + build: + context: . + dockerfile: Dockerfile + target: testing + container_name: tmin-test + volumes: + - .:/app + working_dir: /app + environment: + - PYTHONPATH=/app + + # Production environment + tmin-prod: + build: + context: . + dockerfile: Dockerfile + target: production + container_name: tmin-prod + environment: + - PYTHONPATH=/app + + # Jupyter notebook environment + tmin-jupyter: + build: + context: . + dockerfile: Dockerfile + target: development + container_name: tmin-jupyter + ports: + - "8888:8888" + volumes: + - .:/app + - ./tutorials:/app/tutorials + working_dir: /app + command: jupyter notebook --ip=0.0.0.0 --port=8888 --no-browser --allow-root + environment: + - PYTHONPATH=/app diff --git a/docker-examples.sh b/docker-examples.sh new file mode 100644 index 0000000..0741e6a --- /dev/null +++ b/docker-examples.sh @@ -0,0 +1,127 @@ +#!/bin/bash +# TMIN Docker Usage Examples +# Shows how to use the Docker setup for testing + +set -e + +# Colors for output +GREEN='\033[0;32m' +BLUE='\033[0;34m' +NC='\033[0m' # No Color + +print_example() { + echo -e "${GREEN}$1${NC}" +} + +print_header() { + echo -e "${BLUE}================================${NC}" + echo -e "${BLUE}$1${NC}" + echo -e "${BLUE}================================${NC}" +} + +print_header "TMIN Docker Usage Examples" + +echo "" +print_header "1. Build All Docker Images" +print_example "./docker.sh build" +echo "This builds three images:" +echo " - tmin-dev (development environment)" +echo " - tmin-test (testing environment)" +echo " - tmin-prod (production environment)" + +echo "" +print_header "2. Run Tests in Fresh Container" +print_example "./docker.sh test" +echo "This runs all tests in a clean container environment" + +echo "" +print_example "./docker.sh test-cov" +echo "This runs tests with coverage reporting" + +echo "" +print_header "3. Start Development Environment" +print_example "./docker.sh dev" +echo "This starts a development container with volume mounting" +echo "Then access it with:" +print_example "./docker.sh shell" + +echo "" +print_header "4. Run Code Quality Checks" +print_example "./docker.sh lint" +echo "This runs flake8 and mypy in a fresh container" + +print_example "./docker.sh format" +echo "This formats code with black in a fresh container" + +echo "" +print_header "5. Start Jupyter Notebook" +print_example "./docker.sh jupyter" +echo "This starts Jupyter at http://localhost:8888" + +echo "" +print_header "6. Manual Docker Commands" +print_example "docker run --rm -v \$(pwd):/app tmin-test python -m pytest tests/test_core_dev.py -v" +echo "Run specific test file" + +print_example "docker run --rm -v \$(pwd):/app tmin-test python -m pytest tests/ -m \"not slow\" -v" +echo "Run only fast tests" + +print_example "docker run --rm -v \$(pwd):/app tmin-dev bash" +echo "Open shell in development container" + +echo "" +print_header "7. Clean Up" +print_example "./docker.sh clean" +echo "This cleans up Docker resources" + +print_example "./docker.sh stop" +echo "This stops all running containers" + +echo "" +print_header "8. Multi-Python Version Testing" +print_example "docker build --build-arg PYTHON_VERSION=3.8 -t tmin-test-38 ." +echo "Test with Python 3.8" + +print_example "docker build --build-arg PYTHON_VERSION=3.9 -t tmin-test-39 ." +echo "Test with Python 3.9" + +print_example "docker build --build-arg PYTHON_VERSION=3.10 -t tmin-test-310 ." +echo "Test with Python 3.10" + +print_example "docker build --build-arg PYTHON_VERSION=3.11 -t tmin-test-311 ." +echo "Test with Python 3.11" + +echo "" +print_header "9. Docker Compose Commands" +print_example "docker-compose up -d tmin-dev" +echo "Start development container" + +print_example "docker-compose up -d tmin-test" +echo "Start testing container" + +print_example "docker-compose up -d tmin-jupyter" +echo "Start Jupyter notebook" + +print_example "docker-compose down" +echo "Stop all containers" + +echo "" +print_header "10. Troubleshooting" +print_example "docker-compose ps" +echo "Check container status" + +print_example "./docker.sh logs" +echo "View container logs" + +print_example "docker system prune -a" +echo "Clean up all Docker resources" + +echo "" +print_header "Quick Start Workflow" +echo "1. Make sure Docker is running" +echo "2. Build images: ./docker.sh build" +echo "3. Run tests: ./docker.sh test" +echo "4. Start development: ./docker.sh dev" +echo "5. Access shell: ./docker.sh shell" +echo "" +echo "For more details, see DOCKER_README.md" diff --git a/docker.sh b/docker.sh new file mode 100755 index 0000000..246bb2d --- /dev/null +++ b/docker.sh @@ -0,0 +1,244 @@ +#!/bin/bash +# TMIN Docker Management Script +# Easy commands for Docker operations + +set -e + +# Colors for output +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +BLUE='\033[0;34m' +NC='\033[0m' # No Color + +# Function to print colored output +print_status() { + echo -e "${GREEN}[INFO]${NC} $1" +} + +print_warning() { + echo -e "${YELLOW}[WARNING]${NC} $1" +} + +print_error() { + echo -e "${RED}[ERROR]${NC} $1" +} + +print_header() { + echo -e "${BLUE}================================${NC}" + echo -e "${BLUE}$1${NC}" + echo -e "${BLUE}================================${NC}" +} + +# Function to show help +show_help() { + echo "TMIN Docker Management Script" + echo "" + echo "Usage: $0 [COMMAND]" + echo "" + echo "Commands:" + echo " build Build all Docker images" + echo " dev Start development container" + echo " test Run tests in fresh container" + echo " test-cov Run tests with coverage in fresh container" + echo " lint Run linting in fresh container" + echo " format Format code in fresh container" + echo " clean Clean up Docker resources" + echo " jupyter Start Jupyter notebook server" + echo " shell Open shell in development container" + echo " logs Show container logs" + echo " stop Stop all containers" + echo " help Show this help message" + echo "" + echo "Examples:" + echo " $0 build # Build all images" + echo " $0 test # Run tests in fresh container" + echo " $0 dev # Start development environment" +} + +# Function to build images +build_images() { + print_header "Building TMIN Docker Images" + + print_status "Building development image..." + docker build --target development -t tmin-dev . + + print_status "Building testing image..." + docker build --target testing -t tmin-test . + + print_status "Building production image..." + docker build --target production -t tmin-prod . + + print_status "All images built successfully!" +} + +# Function to start development container +start_dev() { + print_header "Starting TMIN Development Environment" + + # Stop existing containers + docker-compose down 2>/dev/null || true + + print_status "Starting development container..." + docker-compose up -d tmin-dev + + print_status "Development environment ready!" + print_status "To access the container: docker-compose exec tmin-dev bash" + print_status "Or use: $0 shell" +} + +# Function to run tests in fresh container +run_tests() { + print_header "Running Tests in Fresh Container" + + print_status "Building fresh test container..." + docker build --target testing -t tmin-test-fresh . + + print_status "Running tests..." + docker run --rm -v "$(pwd)":/app tmin-test-fresh + + print_status "Tests completed!" +} + +# Function to run tests with coverage +run_tests_cov() { + print_header "Running Tests with Coverage in Fresh Container" + + print_status "Building fresh test container..." + docker build --target testing -t tmin-test-fresh . + + print_status "Running tests with coverage..." + docker run --rm -v "$(pwd)":/app tmin-test-fresh python -m pytest tests/ --cov=tmin --cov-report=term-missing --cov-report=html -v + + print_status "Tests with coverage completed!" + print_status "Coverage report available in htmlcov/index.html" +} + +# Function to run linting +run_lint() { + print_header "Running Linting in Fresh Container" + + print_status "Building fresh development container..." + docker build --target development -t tmin-dev-fresh . + + print_status "Running linting..." + docker run --rm -v "$(pwd)":/app tmin-dev-fresh bash -c "flake8 tmin tests && mypy tmin --ignore-missing-imports" + + print_status "Linting completed!" +} + +# Function to format code +format_code() { + print_header "Formatting Code in Fresh Container" + + print_status "Building fresh development container..." + docker build --target development -t tmin-dev-fresh . + + print_status "Formatting code..." + docker run --rm -v "$(pwd)":/app tmin-dev-fresh black tmin tests + + print_status "Code formatting completed!" +} + +# Function to clean up Docker resources +clean_docker() { + print_header "Cleaning Up Docker Resources" + + print_status "Stopping all containers..." + docker-compose down 2>/dev/null || true + + print_status "Removing unused images..." + docker image prune -f + + print_status "Removing unused containers..." + docker container prune -f + + print_status "Cleaning completed!" +} + +# Function to start Jupyter +start_jupyter() { + print_header "Starting Jupyter Notebook Server" + + print_status "Starting Jupyter container..." + docker-compose up -d tmin-jupyter + + print_status "Jupyter server starting..." + sleep 5 + + print_status "Jupyter notebook available at: http://localhost:8888" + print_status "To stop: docker-compose stop tmin-jupyter" +} + +# Function to open shell +open_shell() { + print_header "Opening Shell in Development Container" + + if ! docker-compose ps tmin-dev | grep -q "Up"; then + print_warning "Development container not running. Starting it..." + start_dev + sleep 3 + fi + + print_status "Opening shell..." + docker-compose exec tmin-dev bash +} + +# Function to show logs +show_logs() { + print_header "Showing Container Logs" + docker-compose logs -f +} + +# Function to stop containers +stop_containers() { + print_header "Stopping All Containers" + docker-compose down + print_status "All containers stopped!" +} + +# Main script logic +case "${1:-help}" in + build) + build_images + ;; + dev) + start_dev + ;; + test) + run_tests + ;; + test-cov) + run_tests_cov + ;; + lint) + run_lint + ;; + format) + format_code + ;; + clean) + clean_docker + ;; + jupyter) + start_jupyter + ;; + shell) + open_shell + ;; + logs) + show_logs + ;; + stop) + stop_containers + ;; + help|--help|-h) + show_help + ;; + *) + print_error "Unknown command: $1" + echo "" + show_help + exit 1 + ;; +esac diff --git a/test-docker.sh b/test-docker.sh new file mode 100755 index 0000000..9f038fd --- /dev/null +++ b/test-docker.sh @@ -0,0 +1,131 @@ +#!/bin/bash +# TMIN Docker Test Script +# Tests Docker configuration without running containers + +set -e + +# Colors for output +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +BLUE='\033[0;34m' +NC='\033[0m' # No Color + +print_status() { + echo -e "${GREEN}[INFO]${NC} $1" +} + +print_error() { + echo -e "${RED}[ERROR]${NC} $1" +} + +print_header() { + echo -e "${BLUE}================================${NC}" + echo -e "${BLUE}$1${NC}" + echo -e "${BLUE}================================${NC}" +} + +# Function to check if file exists +check_file() { + if [ -f "$1" ]; then + print_status "✓ $1 exists" + return 0 + else + print_error "✗ $1 missing" + return 1 + fi +} + +# Function to check Docker syntax +check_dockerfile() { + print_status "Checking Dockerfile syntax..." + if command -v docker >/dev/null 2>&1 && docker info >/dev/null 2>&1; then + # Try to parse the Dockerfile without building + if docker build --no-cache --target base . >/dev/null 2>&1; then + print_status "✓ Dockerfile syntax is valid" + else + print_error "✗ Dockerfile syntax error" + return 1 + fi + else + print_status "⚠ Docker not available or not running, skipping syntax check" + fi +} + +# Function to check docker-compose syntax +check_compose() { + print_status "Checking docker-compose.yml syntax..." + if command -v docker-compose >/dev/null 2>&1; then + if docker-compose config >/dev/null 2>&1; then + print_status "✓ docker-compose.yml syntax is valid" + else + print_error "✗ docker-compose.yml syntax error" + return 1 + fi + else + print_status "⚠ docker-compose not available, skipping syntax check" + fi +} + +# Main test function +main() { + print_header "TMIN Docker Configuration Test" + + local errors=0 + + # Check required files + print_status "Checking required files..." + check_file "Dockerfile" || ((errors++)) + check_file "docker-compose.yml" || ((errors++)) + check_file ".dockerignore" || ((errors++)) + check_file "docker.sh" || ((errors++)) + check_file "DOCKER_README.md" || ((errors++)) + + # Check if docker.sh is executable + if [ -x "docker.sh" ]; then + print_status "✓ docker.sh is executable" + else + print_error "✗ docker.sh is not executable" + ((errors++)) + fi + + # Check Dockerfile syntax + check_dockerfile || ((errors++)) + + # Check docker-compose syntax + check_compose || ((errors++)) + + # Check if pyproject.toml exists (required for Docker build) + check_file "pyproject.toml" || ((errors++)) + + # Check if tmin package exists + if [ -d "tmin" ]; then + print_status "✓ tmin package directory exists" + else + print_error "✗ tmin package directory missing" + ((errors++)) + fi + + # Check if tests directory exists + if [ -d "tests" ]; then + print_status "✓ tests directory exists" + else + print_error "✗ tests directory missing" + ((errors++)) + fi + + print_header "Test Results" + + if [ $errors -eq 0 ]; then + print_status "✓ All Docker configuration tests passed!" + print_status "You can now run: ./docker.sh build" + print_status "Make sure Docker is running first!" + else + print_error "✗ $errors test(s) failed" + print_error "Please fix the issues above before using Docker" + exit 1 + fi +} + +# Run main function +main "$@" diff --git a/tests/__pycache__/test_core.cpython-313-pytest-8.4.1.pyc b/tests/__pycache__/test_core.cpython-313-pytest-8.4.1.pyc index cbb2b2114778034f5928cdc3df0ae463d1b7d168..90fac0e235bcae7dba9f5aaf103956b9ff4cc054 100644 GIT binary patch delta 33 ncmaFT&3M0?k^3_*FBbz47-vk}$bFuV(RT7}KAp`x{5Q-1wTTLa delta 37 rcmccL&G@97k^3_*FBbz4aG$Q*$bFuV(P{E+J{{)V%)HI4{I|>i str: Status: {status} #metadata should be formated in a table - +g ANALYSIS FINDINGS: ------------------