Files
CRM/MISCHLABS_DEPLOYMENT.md
Kroonk 8195bb8ccf
Some checks failed
Build & Push Monica Image to Gitea Registry / build-and-push (push) Failing after 7s
fix: use NAS-local Gitea registry for CRM
2026-05-22 16:53:06 +02:00

85 lines
2.2 KiB
Markdown

# MischLabs Monica Deployment
This repository is the MischLabs fork of Monica CRM, based on the upstream `monicahq/monica` `4.x` branch.
## Repository and Image
- Gitea repository: `https://git.mischlabs.de/MrDiderot/CRM.git`
- Upstream base: `https://github.com/monicahq/monica`, branch `4.x`
- NAS-internal registry image: `localhost:3001/mrdiderot/crm:latest`
- Public Gitea package UI: `https://git.mischlabs.de/MrDiderot/-/packages/container/crm/latest`
- NAS path: `/volume2/docker/mischcrm`
- Default NAS port: `38090:80`
## Architecture
The NAS does not build the image locally. Gitea Actions builds a MischLabs package image from the official Monica Apache image and pushes it to the local Gitea registry through `localhost:3001`. This avoids Cloudflare upload limits for large Docker layers. The NAS runs:
- `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 match the public reverse proxy URL, for example `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 should update `localhost:3001/mrdiderot/crm:latest` automatically after Gitea Actions pushes a new image.
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 the Docker volumes unless you explicitly want to remove Monica data.
If Monica redirects incorrectly behind Cloudflare, check:
- `APP_URL`
- `APP_TRUSTED_PROXIES=*`
- reverse proxy target port `38090`