2025-08-22 16:32:39 -07:00
|
|
|
# Docker Guide (concise)
|
2025-08-21 09:19:20 -07:00
|
|
|
|
2025-08-22 16:32:39 -07:00
|
|
|
Run the MTG Deckbuilder in Docker with persistent volumes and optional headless mode.
|
2025-08-21 09:19:20 -07:00
|
|
|
|
2025-08-22 16:32:39 -07:00
|
|
|
## Quick start
|
2025-08-21 10:28:10 -07:00
|
|
|
|
2025-08-22 16:32:39 -07:00
|
|
|
### PowerShell (recommended)
|
|
|
|
```powershell
|
|
|
|
docker compose build
|
|
|
|
docker compose run --rm mtg-deckbuilder
|
2025-08-21 09:35:32 -07:00
|
|
|
```
|
|
|
|
|
2025-08-22 16:32:39 -07:00
|
|
|
### From Docker Hub (PowerShell)
|
2025-08-21 09:19:20 -07:00
|
|
|
```powershell
|
2025-08-21 10:28:10 -07:00
|
|
|
docker run -it --rm `
|
|
|
|
-v "${PWD}/deck_files:/app/deck_files" `
|
|
|
|
-v "${PWD}/logs:/app/logs" `
|
|
|
|
-v "${PWD}/csv_files:/app/csv_files" `
|
2025-08-25 09:48:05 -07:00
|
|
|
-v "${PWD}/owned_cards:/app/owned_cards" `
|
Web UI: setup progress + logs folding, Finished Decks library, commander search UX (debounce, keyboard, highlights, color chips), ranking fixes (first-word priority, substring include), optional auto-select; setup start reliability (POST+GET), force runs, status with percent/ETA/timestamps; stepwise builder with added stage reporting and sidecar summaries; keyboard grid wrap-around; restrict commander search to eligible rows
2025-08-26 09:48:25 -07:00
|
|
|
## Web UI (new)
|
|
|
|
|
|
|
|
The web UI runs the same deckbuilding logic behind a browser-based interface.
|
|
|
|
|
|
|
|
### PowerShell (recommended)
|
|
|
|
```powershell
|
|
|
|
docker compose build web
|
|
|
|
docker compose up --no-deps web
|
|
|
|
```
|
|
|
|
|
|
|
|
Then open http://localhost:8080
|
|
|
|
|
|
|
|
Volumes are the same as the CLI service, so deck exports/logs/configs persist in your working folder.
|
|
|
|
|
|
|
|
### From Docker Hub (PowerShell)
|
|
|
|
If you prefer not to build locally, pull `mwisnowski/mtg-python-deckbuilder:latest` and run uvicorn:
|
|
|
|
```powershell
|
|
|
|
docker run --rm `
|
|
|
|
-p 8080:8080 `
|
|
|
|
-v "${PWD}/deck_files:/app/deck_files" `
|
|
|
|
-v "${PWD}/logs:/app/logs" `
|
|
|
|
-v "${PWD}/csv_files:/app/csv_files" `
|
|
|
|
-v "${PWD}/owned_cards:/app/owned_cards" `
|
|
|
|
-v "${PWD}/config:/app/config" `
|
|
|
|
mwisnowski/mtg-python-deckbuilder:latest `
|
|
|
|
bash -lc "cd /app && uvicorn code.web.app:app --host 0.0.0.0 --port 8080"
|
|
|
|
```
|
|
|
|
|
|
|
|
---
|
2025-08-25 09:48:05 -07:00
|
|
|
-v "${PWD}/config:/app/config" `
|
2025-08-22 16:32:39 -07:00
|
|
|
mwisnowski/mtg-python-deckbuilder:latest
|
2025-08-21 09:19:20 -07:00
|
|
|
```
|
|
|
|
|
2025-08-22 16:32:39 -07:00
|
|
|
## Volumes
|
|
|
|
- `/app/deck_files` ↔ `./deck_files`
|
|
|
|
- `/app/logs` ↔ `./logs`
|
|
|
|
- `/app/csv_files` ↔ `./csv_files`
|
2025-08-25 09:48:05 -07:00
|
|
|
- `/app/owned_cards` ↔ `./owned_cards` (owned cards lists: .txt/.csv)
|
2025-08-22 16:32:39 -07:00
|
|
|
- Optional: `/app/config` ↔ `./config` (JSON configs for headless)
|
|
|
|
|
|
|
|
## Interactive vs headless
|
|
|
|
- Interactive: attach a TTY (compose run or `docker run -it`)
|
|
|
|
- Headless auto-run:
|
|
|
|
```powershell
|
|
|
|
docker compose run --rm -e DECK_MODE=headless mtg-deckbuilder
|
|
|
|
```
|
|
|
|
- Headless with JSON config:
|
|
|
|
```powershell
|
|
|
|
docker compose run --rm `
|
|
|
|
-e DECK_MODE=headless `
|
|
|
|
-e DECK_CONFIG=/app/config/deck.json `
|
|
|
|
mtg-deckbuilder
|
|
|
|
```
|
|
|
|
|
|
|
|
### Common env vars
|
|
|
|
- DECK_MODE=headless
|
|
|
|
- DECK_CONFIG=/app/config/deck.json
|
|
|
|
- DECK_COMMANDER, DECK_PRIMARY_CHOICE
|
|
|
|
- DECK_ADD_LANDS, DECK_FETCH_COUNT
|
|
|
|
|
|
|
|
## Manual build/run
|
2025-08-21 10:28:10 -07:00
|
|
|
```powershell
|
2025-08-22 16:32:39 -07:00
|
|
|
docker build -t mtg-deckbuilder .
|
2025-08-21 10:28:10 -07:00
|
|
|
docker run -it --rm `
|
|
|
|
-v "${PWD}/deck_files:/app/deck_files" `
|
|
|
|
-v "${PWD}/logs:/app/logs" `
|
|
|
|
-v "${PWD}/csv_files:/app/csv_files" `
|
2025-08-25 09:48:05 -07:00
|
|
|
-v "${PWD}/owned_cards:/app/owned_cards" `
|
|
|
|
-v "${PWD}/config:/app/config" `
|
2025-08-21 10:28:10 -07:00
|
|
|
mtg-deckbuilder
|
|
|
|
```
|
|
|
|
|
2025-08-22 16:32:39 -07:00
|
|
|
## Troubleshooting
|
|
|
|
- No prompts? Use `docker compose run --rm` (not `up`) or add `-it` to `docker run`
|
|
|
|
- Files not saving? Verify volume mounts and that folders exist
|
|
|
|
- Headless not picking config? Ensure `./config` is mounted to `/app/config` and `DECK_CONFIG` points to a JSON file
|
2025-08-25 09:48:05 -07:00
|
|
|
- Owned-cards prompt not seeing files? Ensure `./owned_cards` is mounted to `/app/owned_cards`
|
2025-08-21 09:19:20 -07:00
|
|
|
|
2025-08-22 16:32:39 -07:00
|
|
|
## Tips
|
|
|
|
- Use `docker compose run`, not `up`, for interactive mode
|
|
|
|
- Exported decks appear in `deck_files/`
|
|
|
|
- JSON run-config is exported only in interactive runs; headless skips it
|