|
1 | | -A docker image for ttmp32gme. |
| 1 | +# ttmp32gme Docker/Podman Container |
2 | 2 |
|
3 | | -Set the environment variable `HOST=0.0.0.0` to make ttmp32gme accessible to other computers in your network. |
| 3 | +A containerized version of ttmp32gme that converts MP3/audio files into TipToi GME files. |
4 | 4 |
|
| 5 | +## Features |
| 6 | + |
| 7 | +- **Security**: Runs as non-root user (UID/GID 1000) |
| 8 | +- **Podman Compatible**: Works seamlessly with Podman's user namespace mapping |
| 9 | +- **Persistent Storage**: Separate volumes for configuration and TipToi device |
| 10 | + |
| 11 | +## Quick Start |
| 12 | + |
| 13 | +### Using Docker |
| 14 | + |
| 15 | +```bash |
| 16 | +docker run -d \ |
| 17 | + --rm \ |
| 18 | + --name ttmp32gme \ |
| 19 | + --publish 8080:8080 \ |
| 20 | + --volume ttmp32gme-data:/data \ |
| 21 | + --volume /path/to/tiptoi:/mnt/tiptoi \ |
| 22 | + thawn/ttmp32gme:latest |
| 23 | +``` |
| 24 | + |
| 25 | +### Using Podman |
| 26 | + |
| 27 | +```bash |
| 28 | +podman run -d \ |
| 29 | + --rm \ |
| 30 | + --name ttmp32gme \ |
| 31 | + --publish 8080:8080 \ |
| 32 | + --volume ttmp32gme-data:/data \ |
| 33 | + --volume /path/to/tiptoi:/mnt/tiptoi:Z \ |
| 34 | + thawn/ttmp32gme:latest |
| 35 | +``` |
| 36 | + |
| 37 | +**Note for Podman users**: The `:Z` flag on the TipToi volume enables proper SELinux labeling for shared access. |
| 38 | + |
| 39 | +## Volume Mounts |
| 40 | + |
| 41 | +- **`/data`**: Application data (database, generated library files) |
| 42 | + - First run: Container initializes this directory with default config |
| 43 | + - Subsequent runs: Uses existing data for persistence |
| 44 | + |
| 45 | +- **`/mnt/tiptoi`**: TipToi pen mount point |
| 46 | + - Mount your TipToi device here to directly write generated files |
| 47 | + |
| 48 | +## User Permissions |
| 49 | + |
| 50 | +The container runs as user `ttmp32gme` (UID 1000, GID 1000). |
| 51 | + |
| 52 | +### For Podman Users |
| 53 | + |
| 54 | +Podman automatically maps the container user to your host user, so permissions work seamlessly: |
| 55 | + |
| 56 | +```bash |
| 57 | +# Your files will be owned by your user on the host |
| 58 | +podman run --rm \ |
| 59 | + --volume ./my-data:/data \ |
| 60 | + --volume /media/tiptoi:/mnt/tiptoi:Z \ |
| 61 | + --publish 8080:8080 \ |
| 62 | + thawn/ttmp32gme:latest |
5 | 63 | ``` |
| 64 | + |
| 65 | +### For Docker Users |
| 66 | + |
| 67 | +If you encounter permission issues, you can use these options: |
| 68 | + |
| 69 | +1. **Option 1**: Match your user ID (recommended) |
| 70 | +```bash |
| 71 | +docker run --user $(id -u):$(id -g) \ |
| 72 | + --volume ./my-data:/data \ |
| 73 | + --volume /media/tiptoi:/mnt/tiptoi \ |
| 74 | + --publish 8080:8080 \ |
| 75 | + thawn/ttmp32gme:latest |
| 76 | +``` |
| 77 | + |
| 78 | +2. **Option 2**: Adjust host directory permissions |
| 79 | +```bash |
| 80 | +sudo chown -R 1000:1000 ./my-data |
| 81 | +``` |
| 82 | + |
| 83 | +## Accessing the Application |
| 84 | + |
| 85 | +Once running, open your web browser to: |
| 86 | +- **Local access**: http://localhost:8080 |
| 87 | +- **Network access**: http://your-server-ip:8080 |
| 88 | + |
| 89 | +## Environment Variables |
| 90 | + |
| 91 | +| Variable | Default | Description | |
| 92 | +|----------|---------|-------------| |
| 93 | +| HOST | 0.0.0.0 | Server bind address | |
| 94 | +| PORT | 8080 | Server port | |
| 95 | + |
| 96 | +Example with custom settings: |
| 97 | + |
| 98 | +```bash |
6 | 99 | docker run -d \ |
7 | | - --rm \ |
8 | | - --publish 8080:8080 \ |
9 | | - --volume ${ttmp32gmeStorage}:/var/lib/ttmp32gme \ |
10 | | - --volume </path/to/tiptoi:/mnt/tiptoi \ |
11 | | - -env HOST=127.0.0.1 \ |
12 | | - -env PORT=8080 \ |
13 | | - --name ttmp32gme \ |
14 | | - thawn/ttmp32gme:latest |
| 100 | + --env HOST=127.0.0.1 \ |
| 101 | + --env PORT=9000 \ |
| 102 | + --publish 9000:9000 \ |
| 103 | + --volume ttmp32gme-data:/data \ |
| 104 | + thawn/ttmp32gme:latest |
| 105 | +``` |
| 106 | + |
| 107 | +## Security Features |
| 108 | + |
| 109 | +This container implements security best practices: |
| 110 | + |
| 111 | +- ✅ **Non-root user**: Runs as dedicated `ttmp32gme` user |
| 112 | +- ✅ **Minimal permissions**: Files owned by user with 775/664 permissions |
| 113 | +- ✅ **Explicit volumes**: Declared volume mount points |
| 114 | +- ✅ **Health checks**: Automatic container health monitoring |
| 115 | +- ✅ **Podman ready**: Full compatibility with Podman's rootless mode |
| 116 | + |
| 117 | +## Troubleshooting |
| 118 | + |
| 119 | +### Permission denied errors |
| 120 | + |
| 121 | +If you get "permission denied" errors when accessing volumes: |
| 122 | + |
| 123 | +**For Podman**: |
| 124 | +```bash |
| 125 | +# Add :Z flag for SELinux systems |
| 126 | +podman run --volume /path/to/data:/data:Z ... |
| 127 | +``` |
| 128 | + |
| 129 | +**For Docker**: |
| 130 | +```bash |
| 131 | +# Match your user ID |
| 132 | +docker run --user $(id -u):$(id -g) ... |
| 133 | +``` |
| 134 | + |
| 135 | +### Cannot write to TipToi device |
| 136 | + |
| 137 | +Ensure your TipToi device is mounted with write permissions: |
| 138 | +```bash |
| 139 | +# Check current permissions |
| 140 | +ls -la /media/tiptoi |
| 141 | + |
| 142 | +# If needed, adjust permissions |
| 143 | +sudo chmod 775 /media/tiptoi |
15 | 144 | ``` |
0 commit comments