From 712cc38ef66286aa0f7b3677984760cb7a9a98ce Mon Sep 17 00:00:00 2001 From: mwisnowski Date: Thu, 21 Aug 2025 11:10:31 -0700 Subject: [PATCH] removed reference to an unpublished python package. Corrected a mistyped directory in the dockerhub instructions --- .gitignore | 4 +- DOCKER_HUB_DESCRIPTION.md | 16 ++- README.md | Bin 20664 -> 22058 bytes RELEASE_NOTES.md | 6 +- run-docker.ps1 | 79 ------------ run-docker.sh | 252 -------------------------------------- run-from-dockerhub.bat | 27 ++++ run-from-dockerhub.sh | 25 ++++ 8 files changed, 70 insertions(+), 339 deletions(-) delete mode 100644 run-docker.ps1 delete mode 100644 run-docker.sh create mode 100644 run-from-dockerhub.bat create mode 100644 run-from-dockerhub.sh diff --git a/.gitignore b/.gitignore index a2bc12a..87e7f38 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,4 @@ logs/ non_interactive_test.py test_determinism.py test.py -deterministic_test.py -build.ps1 -*.bat \ No newline at end of file +deterministic_test.py \ No newline at end of file diff --git a/DOCKER_HUB_DESCRIPTION.md b/DOCKER_HUB_DESCRIPTION.md index 6638093..675f193 100644 --- a/DOCKER_HUB_DESCRIPTION.md +++ b/DOCKER_HUB_DESCRIPTION.md @@ -15,8 +15,12 @@ Intelligent MTG Commander/EDH deck builder with theme detection and automated ca # Create a directory for your decks mkdir mtg-decks && cd mtg-decks -# Run the application -docker run -it --rm -v "$(pwd)":/app/host mwisnowski/mtg-python-deckbuilder:latest +# Run the application with proper volume mounting +docker run -it --rm \ + -v "$(pwd)/deck_files":/app/deck_files \ + -v "$(pwd)/logs":/app/logs \ + -v "$(pwd)/csv_files":/app/csv_files \ + mwisnowski/mtg-python-deckbuilder:latest ``` ## Features @@ -34,10 +38,14 @@ docker run -it --rm -v "$(pwd)":/app/host mwisnowski/mtg-python-deckbuilder:late ## Volume Mounts -Mount a local directory to `/app/host` to persist your deck files: +Mount local directories to the following container paths to persist your data: ```bash -docker run -it --rm -v "$(pwd)":/app/host mwisnowski/mtg-python-deckbuilder:latest +docker run -it --rm \ + -v "$(pwd)/deck_files":/app/deck_files \ + -v "$(pwd)/logs":/app/logs \ + -v "$(pwd)/csv_files":/app/csv_files \ + mwisnowski/mtg-python-deckbuilder:latest ``` Your deck files will be saved to: diff --git a/README.md b/README.md index 8d25c2db6d61ef0592d387d77401dcbe9e195abe..edf4def09ce701f04be700df79d0478c3c69e045 100644 GIT binary patch delta 1627 zcmds0OG^S_6g}A@2r9BDXwzT?N$Bh)dlR*Y9u#eY(lTetM>(SfQS%pqZ_~DD6)gle z{e*V?fj0ewcG0SHM-9a+Z7Jft-{YQhAK#g$+qQ?tw)|DEvx*bgFp)+I8fFoq-GYS} zy$!?lViSyuA;VJ(`}C%Z(=g7{2+vG%F*et<>aBmp(UBy;n86$f175+WT(?XzD#QudXMD)Qxw_ zk)9Wr`-~k*wg{^gH7#?W<6a&pfNk0+HfT>dhoWXgC0l$LlhMBVTKQcno_}j4%2I76 zE{ZkF^=pIlmX@RSVH6iw;}jQg zSw|1@h5e=%Y4k7Nl3JW9@s%ai2tloED$A<9t>#QpL?(r)K0_hu%d7I?0rk<-UAXHz cYA-ww8e=W;<#-GE@V%!+ni(p*&b;<~0i+!*&j0`b delta 195 zcmZ3rhH=M2#tn6XlizuB2&XV)G88eSG9)vUFyt^)GAJ;lO`h+fsF}x*4`inUWlMl` zGEgp`ArGid0ZgVcqyX6|42lezlNY*2Pd+9dG`YcnWAYghyUEMkjV4=(bBS6p=rbfT z6ab+Ep%17^i$Kes#l0F8P%#Q*>R diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index b20d493..b659f8d 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -50,7 +50,11 @@ This is the first stable release of the MTG Python Deckbuilder - a comprehensive mkdir mtg-decks && cd mtg-decks # Run directly from Docker Hub -docker run -it --rm -v "$(pwd)":/app/host mwisnowski/mtg-python-deckbuilder:latest +docker run -it --rm \ + -v "$(pwd)/deck_files":/app/deck_files \ + -v "$(pwd)/logs":/app/logs \ + -v "$(pwd)/csv_files":/app/csv_files \ + mwisnowski/mtg-python-deckbuilder:latest ``` ### Option 2: Docker from Source (Recommended for Development) diff --git a/run-docker.ps1 b/run-docker.ps1 deleted file mode 100644 index f2e3565..0000000 --- a/run-docker.ps1 +++ /dev/null @@ -1,79 +0,0 @@ -# MTG Deckbuilder Docker Runner Script -# This script provides easy commands to run the MTG Deckbuilder in Docker with proper volume mounting - -Write-Host "MTG Deckbuilder Docker Helper" -ForegroundColor Green -Write-Host "==============================" -ForegroundColor Green - -function Show-Help { - Write-Host "" - Write-Host "Available commands:" -ForegroundColor Yellow - Write-Host " .\run-docker.ps1 build - Build the Docker image" - Write-Host " .\run-docker.ps1 run - Run the application with volume mounting" - Write-Host " .\run-docker.ps1 compose - Use docker-compose (recommended)" - Write-Host " .\run-docker.ps1 clean - Remove containers and images" - Write-Host " .\run-docker.ps1 help - Show this help" - Write-Host "" -} - -# Get command line argument -$command = $args[0] - -switch ($command) { - "build" { - Write-Host "Building MTG Deckbuilder Docker image..." -ForegroundColor Yellow - docker build -t mtg-deckbuilder . - if ($LASTEXITCODE -eq 0) { - Write-Host "Build successful!" -ForegroundColor Green - } else { - Write-Host "Build failed!" -ForegroundColor Red - } - } - - "run" { - Write-Host "Running MTG Deckbuilder with volume mounting..." -ForegroundColor Yellow - - # Ensure local directories exist - if (!(Test-Path "deck_files")) { New-Item -ItemType Directory -Path "deck_files" } - if (!(Test-Path "logs")) { New-Item -ItemType Directory -Path "logs" } - if (!(Test-Path "csv_files")) { New-Item -ItemType Directory -Path "csv_files" } - - # Run with proper volume mounting - docker run -it --rm ` - -v "${PWD}/deck_files:/app/deck_files" ` - -v "${PWD}/logs:/app/logs" ` - -v "${PWD}/csv_files:/app/csv_files" ` - mtg-deckbuilder - } - - "compose" { - Write-Host "Running MTG Deckbuilder with Docker Compose..." -ForegroundColor Yellow - - # Ensure local directories exist - if (!(Test-Path "deck_files")) { New-Item -ItemType Directory -Path "deck_files" } - if (!(Test-Path "logs")) { New-Item -ItemType Directory -Path "logs" } - if (!(Test-Path "csv_files")) { New-Item -ItemType Directory -Path "csv_files" } - - docker-compose up --build - } - - "clean" { - Write-Host "Cleaning up Docker containers and images..." -ForegroundColor Yellow - docker-compose down 2>$null - docker rmi mtg-deckbuilder 2>$null - docker system prune -f - Write-Host "Cleanup complete!" -ForegroundColor Green - } - - "help" { - Show-Help - } - - default { - Write-Host "Invalid command: $command" -ForegroundColor Red - Show-Help - } -} - -Write-Host "" -Write-Host "Note: Your deck files, logs, and CSV files will be saved in the local directories" -ForegroundColor Cyan -Write-Host "and will persist between Docker runs." -ForegroundColor Cyan diff --git a/run-docker.sh b/run-docker.sh deleted file mode 100644 index 31afa52..0000000 --- a/run-docker.sh +++ /dev/null @@ -1,252 +0,0 @@ -#!/bin/bash -# MTG Deckbuilder Docker Runner Script for Linux/macOS - -set -e # Exit on any error - -echo "MTG Deckbuilder Docker Helper (Linux)" -echo "=====================================" - -# 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}[WARN]${NC} $1" -} - -print_error() { - echo -e "${RED}[ERROR]${NC} $1" -} - -print_debug() { - echo -e "${BLUE}[DEBUG]${NC} $1" -} - -show_help() { - echo "" - echo -e "${YELLOW}Available commands:${NC}" - echo " ./run-docker-linux.sh setup - Initial setup (create directories, check Docker)" - echo " ./run-docker-linux.sh build - Build the Docker image" - echo " ./run-docker-linux.sh run - Run with manual volume mounting" - echo " ./run-docker-linux.sh compose - Use docker-compose run (recommended for interactive)" - echo " ./run-docker-linux.sh compose-build - Build and run with docker-compose" - echo " ./run-docker-linux.sh compose-up - Use docker-compose up (not recommended for interactive)" - echo " ./run-docker-linux.sh debug - Run with debug info and volume verification" - echo " ./run-docker-linux.sh clean - Remove containers and images" - echo " ./run-docker-linux.sh help - Show this help" - echo "" - echo -e "${BLUE}For interactive applications like MTG Deckbuilder:${NC}" - echo -e "${BLUE} - Use 'compose' or 'run' commands${NC}" - echo -e "${BLUE} - Avoid 'compose-up' as it doesn't handle input properly${NC}" -} - -setup_directories() { - print_status "Setting up directories..." - - # Create directories with proper permissions - mkdir -p deck_files logs csv_files - - # Set permissions to ensure Docker can write - chmod 755 deck_files logs csv_files - - print_status "Current directory: $(pwd)" - print_status "Directory structure:" - ls -la | grep -E "(deck_files|logs|csv_files|^d)" - - echo "" - print_status "Directory setup complete!" -} - -check_docker() { - print_status "Checking Docker installation..." - - if ! command -v docker &> /dev/null; then - print_error "Docker is not installed or not in PATH" - exit 1 - fi - - if ! command -v docker-compose &> /dev/null; then - print_warning "docker-compose not found, trying docker compose..." - if ! docker compose version &> /dev/null; then - print_error "Neither docker-compose nor 'docker compose' is available" - exit 1 - else - COMPOSE_CMD="docker compose" - fi - else - COMPOSE_CMD="docker-compose" - fi - - print_status "Docker is available" - print_status "Compose command: $COMPOSE_CMD" -} - -case "$1" in - "setup") - check_docker - setup_directories - print_status "Setup complete! You can now run: ./run-docker-linux.sh compose" - ;; - - "build") - print_status "Building MTG Deckbuilder Docker image..." - docker build -t mtg-deckbuilder . - if [ $? -eq 0 ]; then - print_status "Build successful!" - else - print_error "Build failed!" - exit 1 - fi - ;; - - "run") - print_status "Running MTG Deckbuilder with manual volume mounting..." - - # Ensure directories exist - setup_directories - - print_debug "Volume mounts:" - print_debug " $(pwd)/deck_files -> /app/deck_files" - print_debug " $(pwd)/logs -> /app/logs" - print_debug " $(pwd)/csv_files -> /app/csv_files" - - # Run with proper volume mounting - docker run -it --rm \ - -v "$(pwd)/deck_files:/app/deck_files" \ - -v "$(pwd)/logs:/app/logs" \ - -v "$(pwd)/csv_files:/app/csv_files" \ - -e PYTHONUNBUFFERED=1 \ - -e TERM=xterm-256color \ - mtg-deckbuilder - ;; - - "compose") - print_status "Running MTG Deckbuilder with Docker Compose..." - - # Ensure directories exist - setup_directories - - # Check for compose command - check_docker - - print_debug "Using compose command: $COMPOSE_CMD" - print_debug "Working directory: $(pwd)" - - print_status "Starting interactive session..." - print_warning "Use Ctrl+C to exit when done" - - # Run with compose in interactive mode - $COMPOSE_CMD run --rm mtg-deckbuilder - ;; - - "compose-build") - print_status "Building and running MTG Deckbuilder with Docker Compose..." - - # Ensure directories exist - setup_directories - - # Check for compose command - check_docker - - print_debug "Using compose command: $COMPOSE_CMD" - print_debug "Working directory: $(pwd)" - - print_status "Building image and starting interactive session..." - print_warning "Use Ctrl+C to exit when done" - - # Build and run with compose in interactive mode - $COMPOSE_CMD build - $COMPOSE_CMD run --rm mtg-deckbuilder - ;; - - "compose-up") - print_status "Running MTG Deckbuilder with Docker Compose UP (not recommended for interactive apps)..." - - # Ensure directories exist - setup_directories - - # Check for compose command - check_docker - - print_debug "Using compose command: $COMPOSE_CMD" - print_debug "Working directory: $(pwd)" - - print_warning "This may not work properly for interactive applications!" - print_warning "Use 'compose' command instead for better interactivity" - - # Run with compose - $COMPOSE_CMD up --build - ;; - - "debug") - print_status "Running in debug mode..." - - setup_directories - - print_debug "=== DEBUG INFO ===" - print_debug "Current user: $(whoami)" - print_debug "Current directory: $(pwd)" - print_debug "Directory permissions:" - ls -la deck_files logs csv_files 2>/dev/null || print_warning "Some directories don't exist yet" - - print_debug "=== DOCKER INFO ===" - docker --version - docker info | grep -E "(Operating System|Architecture)" - - print_debug "=== RUNNING CONTAINER ===" - docker run -it --rm \ - -v "$(pwd)/deck_files:/app/deck_files" \ - -v "$(pwd)/logs:/app/logs" \ - -v "$(pwd)/csv_files:/app/csv_files" \ - -e PYTHONUNBUFFERED=1 \ - -e TERM=xterm-256color \ - mtg-deckbuilder /bin/bash -c " - echo 'Container info:' - echo 'Working dir: \$(pwd)' - echo 'Mount points:' - ls -la /app/ - echo 'Testing file creation:' - touch /app/deck_files/test_file.txt - echo 'File created: \$(ls -la /app/deck_files/test_file.txt)' - echo 'Starting application...' - python main.py - " - ;; - - "clean") - print_status "Cleaning up Docker containers and images..." - - check_docker - - # Stop and remove containers - $COMPOSE_CMD down 2>/dev/null || true - docker stop mtg-deckbuilder 2>/dev/null || true - docker rm mtg-deckbuilder 2>/dev/null || true - - # Remove image - docker rmi mtg-deckbuilder 2>/dev/null || true - - # Clean up unused resources - docker system prune -f - - print_status "Cleanup complete!" - ;; - - "help"|*) - show_help - ;; -esac - -echo "" -echo -e "${BLUE}Note: Your deck files, logs, and CSV files will be saved in:${NC}" -echo -e "${BLUE} $(pwd)/deck_files${NC}" -echo -e "${BLUE} $(pwd)/logs${NC}" -echo -e "${BLUE} $(pwd)/csv_files${NC}" diff --git a/run-from-dockerhub.bat b/run-from-dockerhub.bat new file mode 100644 index 0000000..58754b0 --- /dev/null +++ b/run-from-dockerhub.bat @@ -0,0 +1,27 @@ +@echo off +echo MTG Python Deckbuilder - Docker Hub Runner +echo =========================================== + +REM Create directories if they don't exist +if not exist "deck_files" mkdir deck_files +if not exist "logs" mkdir logs +if not exist "csv_files" mkdir csv_files + +echo Starting MTG Python Deckbuilder from Docker Hub... +echo Your files will be saved in the current directory: +echo - deck_files\: Your completed decks +echo - logs\: Application logs +echo - csv_files\: Card database files +echo. + +REM Run the Docker container with proper volume mounts +docker run -it --rm ^ + -v "%cd%\deck_files:/app/deck_files" ^ + -v "%cd%\logs:/app/logs" ^ + -v "%cd%\csv_files:/app/csv_files" ^ + mwisnowski/mtg-python-deckbuilder:latest + +echo. +echo MTG Python Deckbuilder session ended. +echo Your files are saved in: %cd% +pause diff --git a/run-from-dockerhub.sh b/run-from-dockerhub.sh new file mode 100644 index 0000000..1a7c0e7 --- /dev/null +++ b/run-from-dockerhub.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +echo "MTG Python Deckbuilder - Docker Hub Runner" +echo "===========================================" + +# Create directories if they don't exist +mkdir -p deck_files logs csv_files + +echo "Starting MTG Python Deckbuilder from Docker Hub..." +echo "Your files will be saved in the current directory:" +echo " - deck_files/: Your completed decks" +echo " - logs/: Application logs" +echo " - csv_files/: Card database files" +echo + +# Run the Docker container with proper volume mounts +docker run -it --rm \ + -v "$(pwd)/deck_files":/app/deck_files \ + -v "$(pwd)/logs":/app/logs \ + -v "$(pwd)/csv_files":/app/csv_files \ + mwisnowski/mtg-python-deckbuilder:latest + +echo +echo "MTG Python Deckbuilder session ended." +echo "Your files are saved in: $(pwd)"