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" `
|
|
|
|
-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
|