3.2 KiB
Deploying on Unraid
The MRP app is a single Docker container that stores everything (SQLite database + uploaded files + backups) under a single /data volume.
1. Prepare environment
Pick a host directory on your Unraid array (example: /mnt/user/appdata/mrp-qrcode/). This will hold the database and uploaded files, and will survive container upgrades.
Generate a strong app secret:
node -e "console.log(require('crypto').randomBytes(48).toString('base64url'))"
2. docker-compose (recommended)
Create .env next to docker-compose.yml:
APP_URL=https://mrp.yourdomain.tld
APP_SECRET=<paste-the-secret-from-step-1>
BOOTSTRAP_ADMIN_EMAIL=you@yourdomain.tld
BOOTSTRAP_ADMIN_PASSWORD=<a-strong-password>
BOOTSTRAP_ADMIN_NAME=Your Name
Then:
docker compose up -d --build
The container will:
- Create
/data/uploadsand/data/backupsinside the volume. - Run
prisma migrate deploy. - Create the bootstrap admin if no admin exists.
- Start the web server on port 3000.
3. Bind the /data volume to host storage (Unraid)
If you prefer a host bind mount over the named volume, replace the volumes: block in docker-compose.yml with:
volumes:
- /mnt/user/appdata/mrp-qrcode:/data
Make sure the host directory is owned by UID 1001 (the nextjs user inside the container):
mkdir -p /mnt/user/appdata/mrp-qrcode
chown -R 1001:1001 /mnt/user/appdata/mrp-qrcode
4. Reverse proxy / subdomain
Point your reverse proxy (SWAG, Nginx Proxy Manager, Caddy, Traefik — whatever is already on your Unraid) at http://<container-ip>:3000 and terminate TLS there.
APP_URL must match the externally reachable URL — it is embedded in QR code payloads and used for absolute links. If operators scan a card and land on http://10.x.x.x:3000, their phone probably cannot reach that IP; always set APP_URL to the public subdomain.
5. Backups
The container does not yet run automatic backups. Until step 9 of the build plan ships, back up /data with your Unraid backup strategy:
/data/app.db(SQLite file)/data/app.db-waland/data/app.db-shmif present (SQLite WAL sidecars)/data/uploads/
A safe way to snapshot a live SQLite DB is:
docker exec mrp-qrcode sqlite3 /data/app.db ".backup '/data/backups/app-$(date +%F).db'"
6. Upgrades
git pull
docker compose up -d --build
Migrations run automatically on start. Before major upgrades, snapshot the DB as above.
7. First-login checklist
- Sign in at
/login/adminwith the bootstrap credentials. - Change your password (admin settings — shipping in a later step).
- Create your operators (each gets a name and a 4-digit PIN).
- Add your machines.
- Create operation templates for repetitive steps.
- Create your first project.
Troubleshooting
APP_SECRET must be at least 32 chars— the container refuses to start without one. Regenerate as shown in step 1.migrations/is empty — runnpx prisma migrate dev --name initlocally once, commit the generatedprisma/migrations/directory, rebuild the image.- Healthcheck failing —
docker logs mrp-qrcodeand check DB permissions on/data.