Files
CRM/MISCHLABS_DEPLOYMENT.md

85 lines
1.9 KiB
Markdown

# MischLabs Monica Deployment
This repository now acts as the MischLabs deployment repository for Monica CRM.
The NAS runs the official Docker image directly instead of building and pushing a custom image through Gitea.
## Repository and Image
- Gitea repository: `https://git.mischlabs.de/MrDiderot/CRM.git`
- Runtime image: `monica:4-apache`
- NAS path: `/volume2/docker/mischcrm`
- Default NAS port: `38090:80`
- Public URL: `https://crm.mischlabs.de`
## Architecture
The NAS pulls Monica directly from Docker Hub. This avoids Cloudflare upload limits for large Docker layers and keeps the setup simple.
- `mischcrm`: Monica Apache web container
- `mischcrm_cron`: Monica scheduler container using `cron.sh`
- `mischcrm_db`: MariaDB 11
Persistent Docker volumes:
- `mischcrm_monica_storage`: Monica storage, OAuth keys, uploads, logs
- `mischcrm_monica_db`: MariaDB data
## First Start on NAS
```bash
cd /volume2/docker/mischcrm
cp .env.mischlabs.example .env
```
Generate secrets:
```bash
openssl rand -base64 32
openssl rand -hex 32
```
Edit `.env`:
- `APP_KEY` must be `base64:<openssl rand -base64 32 output>`
- `DB_PASSWORD` must be the long random hex password
- `APP_URL` must be `https://crm.mischlabs.de`
Then start:
```bash
docker compose pull
docker compose up -d
```
Check:
```bash
docker ps --filter "name=mischcrm" --format "table {{.Names}}\t{{.Image}}\t{{.Status}}\t{{.Ports}}"
docker logs mischcrm --tail=120
```
## Updates
Watchtower updates `monica:4-apache` directly from Docker Hub.
Manual update:
```bash
cd /volume2/docker/mischcrm
git pull --ff-only
docker compose pull
docker compose up -d
```
## Important
Do not commit `.env`.
Do not delete Docker volumes unless you explicitly want to remove Monica data.
If Monica redirects incorrectly behind Cloudflare, check:
- `APP_URL`
- `APP_TRUSTED_PROXIES=*`
- Cloudflare tunnel target port `38090`