fix(immich): name containers underscore to match runtime lifecycle code

package.stop/start/restart broke ("no containers found" / "no such object
immich_postgres") because the runtime hardcodes the immich stack's container names
as immich_server/immich_postgres/immich_redis (underscore) across 8 files
(lifecycle, health, crash-recovery, ports, config). The migration had named the
containers by app_id (hyphen), mismatching all of it.

Root cause of the earlier failed attempt: container_name was nested under an
`extensions:` block, but `app.extensions` is serde(flatten) — container_name must
be a TOP-LEVEL app key to be read by compute_container_name. Fixed: set
container_name: immich_server / immich_postgres / immich_redis at top level, and
point DB_HOSTNAME/REDIS_HOSTNAME at the underscore aliases. App ids stay hyphen
(immich/immich-postgres/immich-redis) so the catalog identity (title+icon) holds.

Manifest-only change — container names now match existing runtime references, no
code edits to the 8 files. (Deriving stack containers from manifests instead of
hardcoded lists remains a north-star follow-up.)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
archipelago 2026-06-21 09:20:38 -04:00
parent b1f175b927
commit f0c6b79d1a
3 changed files with 16 additions and 9 deletions

View File

@ -4,10 +4,11 @@ app:
version: "14-vectorchord0.4.3-pgvectors0.2.0" version: "14-vectorchord0.4.3-pgvectors0.2.0"
description: Postgres (pgvecto.rs / vectorchord) backend for Immich. description: Postgres (pgvecto.rs / vectorchord) backend for Immich.
# No container_name override: the container is named by app_id (immich-postgres), # Container named immich_postgres (underscore) to match the runtime's existing
# which is also its archy-net alias and the server's DB_HOSTNAME. (Overriding the # per-app references (lifecycle/health/crash-recovery/config) and serve as the
# name diverges from the orchestrator's app_id-based naming and spawns duplicate # server's DB_HOSTNAME alias. Top-level key → serde(flatten) → extensions →
# containers — mirror the btcpay stack, which names members by app_id.) # compute_container_name.
container_name: immich_postgres
container: container:
image: 146.59.87.168:3000/lfg2025/immich-postgres:14-vectorchord0.4.3-pgvectors0.2.0 image: 146.59.87.168:3000/lfg2025/immich-postgres:14-vectorchord0.4.3-pgvectors0.2.0

View File

@ -4,7 +4,9 @@ app:
version: "7-alpine" version: "7-alpine"
description: Valkey (Redis-compatible) cache for Immich. description: Valkey (Redis-compatible) cache for Immich.
# Named by app_id (immich-redis) = archy-net alias = server's REDIS_HOSTNAME. # Container named immich_redis (underscore) to match runtime per-app references
# and serve as the server's REDIS_HOSTNAME alias on archy-net.
container_name: immich_redis
container: container:
image: 146.59.87.168:3000/lfg2025/valkey:7-alpine image: 146.59.87.168:3000/lfg2025/valkey:7-alpine

View File

@ -5,8 +5,12 @@ app:
description: Self-hosted photo and video backup with mobile apps and search. description: Self-hosted photo and video backup with mobile apps and search.
# app_id "immich" = the user-facing launcher (matches the catalog entry's title # app_id "immich" = the user-facing launcher (matches the catalog entry's title
# + icon). Container is named "immich"; it reaches its backends by their app_id # + icon). The container is named "immich_server" so it matches the runtime's
# aliases on archy-net (see DB_HOSTNAME / REDIS_HOSTNAME below). # existing per-app container references (lifecycle/health/crash-recovery/ports);
# `container_name` is a top-level app key (captured by serde(flatten) into
# extensions, read by compute_container_name). It reaches its backends by their
# underscore aliases on archy-net (DB_HOSTNAME / REDIS_HOSTNAME below).
container_name: immich_server
container: container:
image: 146.59.87.168:3000/lfg2025/immich-server:release image: 146.59.87.168:3000/lfg2025/immich-server:release
@ -42,10 +46,10 @@ app:
options: [rw] options: [rw]
environment: environment:
- DB_HOSTNAME=immich-postgres - DB_HOSTNAME=immich_postgres
- DB_USERNAME=postgres - DB_USERNAME=postgres
- DB_DATABASE_NAME=immich - DB_DATABASE_NAME=immich
- REDIS_HOSTNAME=immich-redis - REDIS_HOSTNAME=immich_redis
- UPLOAD_LOCATION=/usr/src/app/upload - UPLOAD_LOCATION=/usr/src/app/upload
health_check: health_check: