mirror of
https://gitea.zaclys.com/yannic/selfhosting.git
synced 2026-05-23 19:37:28 +02:00
4.0 KiB
4.0 KiB
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Overview
A collection of Docker Compose recipes for self-hosted services. Each service lives in a numbered directory (e.g. 01-blog/, 08-immich/) containing a single docker-compose.<name>.yml file.
Deploying services
Copy .env.default to .env and configure it. The DEPLOY variable is a space-separated list of directory names to activate:
DEPLOY=01-blog 04-gitea 07-ntfy
Run all active services at once:
./run-docker-compose.sh --env-file .env up -d
./run-docker-compose.sh --env-file .env down
Or target a single service directly:
docker compose --env-file .env -f 01-blog/docker-compose.blog.yml up -d
docker compose --env-file .env -f 01-blog/docker-compose.blog.yml logs -f
Repository structure
| Directory | Service | Port |
|---|---|---|
00-diun |
Docker image update notifier (reads $ROOT_INSTALL/data/diun/diun.yml) |
— |
00-tugtainer |
Tugtainer agent — exposes Docker API via socket proxy | 9413 |
01-blog |
Custom blog + Stacosys comments (private registry: source.madyanne.fr) |
8011 |
02-selfoss |
Self-hosted RSS reader | 8888 |
03-shaarli |
Bookmark manager | 8013 |
04-gitea |
Git hosting (rootless, SSH on 2222) | 8014 |
05-wallabag |
Read-it-later | 8015 |
06-heimdall |
Application dashboard | 8016 |
07-ntfy |
Push notification server | 8017 |
07-seafile |
File sync (MariaDB + Memcached stack) | 8017/8080 |
08-immich |
Photo management (Postgres + Redis + ML stack) | 2283 |
08-ittools |
IT-Tools web app | 8018 |
09-bichon |
Email client | 8019 |
09-navidrome |
Music streaming (reads music from $SEAFILE_ZIC) |
4533 |
10-monitor |
Tugtainer monitoring dashboard with socket proxy | 9412 |
Key conventions
- Persistent data: bind-mounted from
$ROOT_INSTALL/data/<service>/on the host (default/srv/data/<service>/). Named Docker volumes are used for cache/ephemeral data. - Common env vars:
TZ,PUID,PGID,ROOT_INSTALL,DOMAIN— set once in.env, referenced across all compose files. - Socket proxy pattern: services that need Docker API access (tugtainer, monitor) use
lscr.io/linuxserver/socket-proxyinstead of mounting the socket directly. - Private images:
01-blogand02-selfosspull fromsource.madyanne.fr.GIT_TOKENis passed to the blog container for private repo access. - Seafile bind mounts:
08-immichand09-navidromemount Seafile storage viarslavepropagation and requireprivileged: true+SYS_ADMINcap.
Adding a new service
- Create a new numbered directory (pick a prefix that reflects priority/grouping).
- Add a
docker-compose.<name>.ymlinside it. - Reference shared variables from
.envusing${VAR}syntax. - Add the directory name to the
DEPLOYline in.envto activate it. - Document any new required variables in
.env.default.
Compose file conventions
- Image overrides: images use
${IMAGE_VAR:-default:tag}syntax so the tag can be pinned via.envwithout editing the compose file. - Healthchecks: multi-container stacks define
healthcheck:on dependencies and usedepends_on: <svc>: condition: service_healthyto enforce startup order. - Named volumes are used for mutable app state that doesn't need direct host access (DB data, caches). Use bind mounts only when the host path matters (e.g. backup targets, shared Seafile storage).
run-docker-compose.shreadsDEPLOYdirectly from.env(ignoring any--env-fileargument for that purpose), so.envmust always exist at the repo root.
Useful .env.default groupings
The default file includes commented-out DEPLOY examples showing how services are grouped for deployment:
- Full stack:
00-tugtainer 01-blog 02-selfoss 03-shaarli 04-gitea 05-wallabag 06-heimdall 07-ntfy 08-ittools 09-bichon - Seafile cluster:
00-tugtainer 07-seafile - Media stack:
08-immich 09-navidrome