Skip to content

Container lifecycle conventions: Docker-managed restarts and journald logging #49

@mairas

Description

@mairas

Overview

Establish new container lifecycle conventions across all HaLOS container apps to properly support multi-service compose files (sidekick containers).

Background

PR halos-org/halos-core-containers#5 adds a sidekick asset-server container to homarr. This revealed that the current container lifecycle conventions don't work well with multi-service compose files:

Previous convention (now being replaced):

  • restart: no - systemd manages the entire compose lifecycle
  • This breaks with multi-service compose files: if one container dies, systemd won't know (docker compose keeps running while one container is dead)

New convention:

  1. Restart policy: restart: unless-stopped - Docker handles per-container restarts, systemd is fallback for compose process failures
  2. Logging: logging: driver: journald - unified logging with per-container filtering via journalctl

Benefits

Concern Solution
Container crash recovery Docker handles it (fast, per-container)
Service-level failures systemd handles it (fallback)
Unified logging journald (one place, journalctl -u <service>)
Per-container filtering journald metadata (journalctl CONTAINER_NAME=x)
No log duplication journald driver replaces json-file

Implementation Plan

  1. container-packaging-tools: Add validation for new conventions - Add validation for container lifecycle conventions (restart policy, logging driver) container-packaging-tools#124 ✅ DONE
  2. halos-core-containers: Update homarr (PR Remove casaos-marine-store submodule #5) to follow new conventions ✅ MERGED
  3. halos-marine-containers: Update all marine apps - feat(apps): apply container lifecycle conventions halos-marine-containers#53
  4. halos-imported-containers: CasaOS converter already uses new conventions (transformer.py lines 715-721) ✅ DONE

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions