|
|
||
|---|---|---|
| .forgejo/workflows | ||
| .env.example | ||
| .gitignore | ||
| docker-compose.yml | ||
| README.md | ||
shared-services
Shared, non-app-specific backing services used by more than one app: Meilisearch, MariaDB, PostgreSQL, Redis, and InfluxDB. Each service gets its own external network and named volume, so apps attach only to the ones they actually need.
cp .env.example .env # then fill in every *_PASSWORD / *_KEY value
docker compose up -d
Meilisearch
Owns the meili-shared external network. No host port is published; it's reachable only from containers on that network.
- Connect from an app with
MEILI_HOST=http://meilisearch:7700andMEILI_API_KEY=<MEILI_MASTER_KEY>. - Data persists in the
meili_datavolume. - One instance, one index per app — use your own index name in each app's Meilisearch client code.
MariaDB
Owns the mariadb-shared external network.
- Connect from an app with a
mariadb-sharednetwork attachment, hostmariadb-shared-db, and the root credentials (or a per-app user you create yourself). - Data persists in the
mariadbdatavolume. - Pinned to the current LTS (
12.3).MARIADB_AUTO_UPGRADErunsmariadb-upgradeon start after an image bump; take amariadb-dumpfirst, since a major upgrade can't be rolled back.
PostgreSQL
Owns the pg-shared external network (compose service/network key is postgres-shared).
- Connect from an app with a
pg-sharednetwork attachment, hostpg-shared-db,POSTGRES_USER/POSTGRES_PASSWORD. - Data persists in the
pgdatavolume.
Redis
Owns the redis-shared external network.
- Connect from an app with a
redis-sharednetwork attachment, hostredis-shared-db, andREDIS_PASSWORD. - Data persists in the
redisdatavolume. - RedisInsight (a web UI for browsing keys) is published on
127.0.0.1:5540— loopback only, since it has no built-in auth of its own and would otherwise give full read/write access to every app's Redis data to anyone who finds the port. Use an SSH tunnel (ssh -L 5540:localhost:5540 <host>) for remote access.
InfluxDB
Owns the influxdb-shared external network, plus 127.0.0.1:8086 on the host — loopback-only, not reachable from the LAN. That's for the evcc-influx-aggregate.sh cron job, which runs directly on the host (not in a container) and has no other way to reach a container-network-only service; it already connects via localhost, so no config change needed there. Containers should use the Docker network instead of this port.
- Connect from an app with an
influxdb-sharednetwork attachment, hostinfluxdb-shared-db, port8086, and theINFLUXDB_ADMIN_USER/INFLUXDB_ADMIN_PASSWORDcredentials. - Data persists in the
influxdbdatavolume — this reuses the pre-existinginfluxdb_influxdb-datavolume from evcc's original standalone InfluxDB stack, so history isn't lost by moving it here. - The 1.11+ image runs as
influxdb(UID/GID 1500), unlike 1.8 which ran as root, so the volume must be owned by1500:1500(chowned when upgrading from 1.8). - Holds
evcc,evcc_aggrandhomeassistant(Home Assistant writes via127.0.0.1:8086, since it runs with host networking) — InfluxDB 1.x supports multiple databases on one instance, so additional apps can add their ownINFLUXDB_DBrather than needing a second instance.
Adding another app
- Add the relevant network(s) above as
external: truein the app'sdocker-compose.yml. - Give the app the matching host/credential env vars.
- Don't publish DB ports on the app side — connectivity goes over the shared Docker network only.
Maintenance
docker compose logs <service>for troubleshooting.- Updates: Watchtower auto-updates MariaDB, PostgreSQL, Redis and InfluxDB within their pinned tag (
12.3,18,8-alpine,1.13); Diun notifies (notify_on=new) only when a newer version tag appears. Meilisearch is pinned to an exact version and notify-only: upgrade by taking a snapshot + dump, bumping the tag and starting once withMEILI_UPGRADE_DB=true. RedisInsight is fully auto-updated and not watched by Diun. - MariaDB/PostgreSQL/InfluxDB only consult their root/admin password env var on first init of an empty volume; changing it later has no effect on an already-initialized database. Redis re-applies
REDIS_PASSWORDon every start (via--requirepass), so it must stay in sync with whatever clients already use to authenticate.