Add installation guide
This commit is contained in:
235
INSTALL.md
Normal file
235
INSTALL.md
Normal file
@@ -0,0 +1,235 @@
|
||||
# BREEDR Installation Guide
|
||||
|
||||
## Quick Start - Unraid Deployment
|
||||
|
||||
### Step 1: Clone the Repository
|
||||
|
||||
SSH into your Unraid server and run:
|
||||
|
||||
```bash
|
||||
cd /tmp
|
||||
git clone https://git.alwisp.com/jason/breedr.git
|
||||
cd breedr
|
||||
```
|
||||
|
||||
### Step 2: Build the Docker Image
|
||||
|
||||
```bash
|
||||
docker build -t breedr:latest .
|
||||
```
|
||||
|
||||
This will:
|
||||
- Install all Node.js dependencies automatically
|
||||
- Build the React frontend
|
||||
- Set up the SQLite database
|
||||
- Create a production-ready container
|
||||
|
||||
**Build time:** Approximately 3-5 minutes depending on your server.
|
||||
|
||||
### Step 3: Deploy via Unraid UI
|
||||
|
||||
1. Open Unraid web interface
|
||||
2. Navigate to the **Docker** tab
|
||||
3. Click **Add Container**
|
||||
4. Configure the following:
|
||||
|
||||
#### Basic Settings
|
||||
- **Name:** `Breedr`
|
||||
- **Repository:** `breedr:latest`
|
||||
- **Network Type:** `Bridge`
|
||||
|
||||
#### Port Mappings
|
||||
- **Container Port:** `3000`
|
||||
- **Host Port:** `3000` (or your preferred port)
|
||||
- **Connection Type:** `TCP`
|
||||
|
||||
#### Volume Mappings
|
||||
|
||||
**Path 1 - Database Storage:**
|
||||
- **Container Path:** `/app/data`
|
||||
- **Host Path:** `/mnt/user/appdata/breedr`
|
||||
- **Access Mode:** `Read/Write`
|
||||
|
||||
**Path 2 - Photo Uploads:**
|
||||
- **Container Path:** `/app/uploads`
|
||||
- **Host Path:** `/mnt/user/appdata/breedr/uploads`
|
||||
- **Access Mode:** `Read/Write`
|
||||
|
||||
#### Extra Parameters (Optional)
|
||||
```
|
||||
--restart=unless-stopped
|
||||
```
|
||||
|
||||
5. Click **Apply**
|
||||
|
||||
### Step 4: Access BREEDR
|
||||
|
||||
Open your browser and navigate to:
|
||||
```
|
||||
http://[YOUR-UNRAID-IP]:3000
|
||||
```
|
||||
|
||||
For example: `http://192.168.1.100:3000`
|
||||
|
||||
---
|
||||
|
||||
## Alternative: Command Line Deployment
|
||||
|
||||
If you prefer command line deployment:
|
||||
|
||||
```bash
|
||||
docker run -d \
|
||||
--name=breedr \
|
||||
-p 3000:3000 \
|
||||
-v /mnt/user/appdata/breedr:/app/data \
|
||||
-v /mnt/user/appdata/breedr/uploads:/app/uploads \
|
||||
--restart unless-stopped \
|
||||
breedr:latest
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Verifying Installation
|
||||
|
||||
### Check Container Status
|
||||
```bash
|
||||
docker ps | grep breedr
|
||||
```
|
||||
|
||||
### View Container Logs
|
||||
```bash
|
||||
docker logs breedr
|
||||
```
|
||||
|
||||
You should see:
|
||||
```
|
||||
🐕 BREEDR Server Running
|
||||
================================
|
||||
Environment: production
|
||||
Port: 3000
|
||||
Database: /app/data/breedr.db
|
||||
Uploads: /app/uploads
|
||||
Access: http://localhost:3000
|
||||
================================
|
||||
```
|
||||
|
||||
### Test Health Endpoint
|
||||
```bash
|
||||
curl http://localhost:3000/api/health
|
||||
```
|
||||
|
||||
Should return:
|
||||
```json
|
||||
{"status":"ok","timestamp":"..."}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Updating BREEDR
|
||||
|
||||
To update to the latest version:
|
||||
|
||||
```bash
|
||||
# Stop and remove old container
|
||||
docker stop breedr
|
||||
docker rm breedr
|
||||
|
||||
# Pull latest code
|
||||
cd /tmp/breedr
|
||||
git pull origin master
|
||||
|
||||
# Rebuild image
|
||||
docker build -t breedr:latest .
|
||||
|
||||
# Redeploy (data persists in volumes)
|
||||
docker run -d \
|
||||
--name=breedr \
|
||||
-p 3000:3000 \
|
||||
-v /mnt/user/appdata/breedr:/app/data \
|
||||
-v /mnt/user/appdata/breedr/uploads:/app/uploads \
|
||||
--restart unless-stopped \
|
||||
breedr:latest
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Backup & Restore
|
||||
|
||||
### Backup
|
||||
|
||||
Your data is stored in two locations:
|
||||
|
||||
1. **Database:** `/mnt/user/appdata/breedr/breedr.db`
|
||||
2. **Photos:** `/mnt/user/appdata/breedr/uploads/`
|
||||
|
||||
To backup:
|
||||
```bash
|
||||
tar -czf breedr-backup-$(date +%Y%m%d).tar.gz /mnt/user/appdata/breedr/
|
||||
```
|
||||
|
||||
### Restore
|
||||
|
||||
```bash
|
||||
tar -xzf breedr-backup-YYYYMMDD.tar.gz -C /
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Container won't start
|
||||
|
||||
```bash
|
||||
# Check logs for errors
|
||||
docker logs breedr
|
||||
|
||||
# Ensure ports aren't in use
|
||||
netstat -tulpn | grep 3000
|
||||
```
|
||||
|
||||
### Database errors
|
||||
|
||||
```bash
|
||||
# Reinitialize database
|
||||
docker exec -it breedr node server/db/init.js
|
||||
```
|
||||
|
||||
### Permission issues
|
||||
|
||||
```bash
|
||||
# Fix permissions
|
||||
chown -R nobody:users /mnt/user/appdata/breedr
|
||||
chmod -R 755 /mnt/user/appdata/breedr
|
||||
```
|
||||
|
||||
### Can't access web interface
|
||||
|
||||
1. Verify container is running: `docker ps`
|
||||
2. Check firewall settings
|
||||
3. Verify port mapping: `docker port breedr`
|
||||
4. Check Unraid network settings
|
||||
|
||||
---
|
||||
|
||||
## Uninstalling
|
||||
|
||||
```bash
|
||||
# Stop and remove container
|
||||
docker stop breedr
|
||||
docker rm breedr
|
||||
|
||||
# Remove image
|
||||
docker rmi breedr:latest
|
||||
|
||||
# Remove data (WARNING: This deletes all your data!)
|
||||
rm -rf /mnt/user/appdata/breedr
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Support
|
||||
|
||||
For issues or questions:
|
||||
1. Check the logs: `docker logs breedr`
|
||||
2. Review the README.md
|
||||
3. Contact your system administrator
|
||||
Reference in New Issue
Block a user