docs: add production deployment example with volumes and .env

- docker/docker-compose.prod.yml: pulls image from 192.168.0.19:5000,
  mounts config/, wiki/ and db/ as separate volumes, health check, TZ support
- .env.example: fully commented template for all env vars
- .gitignore: ignore .env, always track .env.example
- README: deployment section with step-by-step guide, volume table, backup commands
- config.go: default db_path to /data/db/archivum.db (matches prod volume layout)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-10 13:54:39 +02:00
parent d0db5cd59d
commit 66eafd9d3c
5 changed files with 222 additions and 0 deletions

View File

@@ -115,6 +115,88 @@ npm run dev
| `PUID` | `1000` | File system user ID |
| `PGID` | `1000` | File system group ID |
## Production Deployment
### Directory layout on the host
```
/opt/archivum/
├── config/
│ └── config.json ← written by Setup Wizard on first access
├── wiki/ ← AsciiDoc files + git repository
└── db/
└── archivum.db ← SQLite database (auto-created)
```
### Steps
```bash
# 1. Create host directories
mkdir -p /opt/archivum/{config,wiki,db}
# 2. Set ownership to match PUID/PGID (default 1000:1000)
chown -R 1000:1000 /opt/archivum
# 3. Copy and edit the environment file
cp .env.example .env
# Edit .env — at minimum check PUID, PGID and HOST_PORT
# 4. Allow the insecure local registry (if not already done)
# Add to /etc/docker/daemon.json:
# { "insecure-registries": ["192.168.0.19:5000"] }
# Then: sudo systemctl restart docker
# 5. Pull and start
docker compose -f docker/docker-compose.prod.yml pull
docker compose -f docker/docker-compose.prod.yml up -d
# 6. View logs
docker compose -f docker/docker-compose.prod.yml logs -f
```
Open `http://<host>:8080` and complete the Setup Wizard.
### Example `.env`
```dotenv
REGISTRY=192.168.0.19:5000
IMAGE_TAG=latest
ARCHIVUM_CONFIG=/opt/archivum/config
ARCHIVUM_WIKI=/opt/archivum/wiki
ARCHIVUM_DB=/opt/archivum/db
HOST_PORT=8080
PUID=1000
PGID=1000
TZ=Europe/Stockholm
```
> A fully commented template is available at [`.env.example`](.env.example).
### Volumes at a glance
| Container path | Maps to (default) | Purpose |
|---|---|---|
| `/config` | `/opt/archivum/config` | `config.json` (backend) + `settings.json` (frontend) |
| `/data/wiki` | `/opt/archivum/wiki` | AsciiDoc source files + git repo |
| `/data/db` | `/opt/archivum/db` | SQLite database (`archivum.db`) |
### Backup
```bash
# Wiki content (git repo — just rsync or tar)
tar czf archivum-wiki-$(date +%F).tar.gz /opt/archivum/wiki
# Database
cp /opt/archivum/db/archivum.db archivum-db-$(date +%F).db
# Config
cp /opt/archivum/config/config.json archivum-config-$(date +%F).json
```
---
## VS Code Tasks
Open the Command Palette (`Ctrl+Shift+P`) → **Tasks: Run Task**: