From 7a54cd1f93c9130b5e846314463f5a62cf88b531 Mon Sep 17 00:00:00 2001 From: Ross Patterson Date: Sun, 24 Aug 2025 19:09:51 -0700 Subject: [PATCH] build(compose): Type safe and consistent YAML - Avoid YAML type conversion/casting magic: https://www.rpatterson.net/blog/docker-gotchas/#yaml-needs-some-zen https://sidneyliebrand.medium.com/the-greatnesses-and-gotchas-of-yaml-5e3377ef0c55 - Prefer mappings over `"...=..."` strings such as for `environment:`: YAML mappings better describe the declaritive intention of those parts of the configuration. Use mappings where order doesn't matter and YAML arrays/lists make confuguration less readable. --- docker/testing/docker-compose.yml | 56 +++++++++++++++---------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/docker/testing/docker-compose.yml b/docker/testing/docker-compose.yml index 432d0098..f3eacb9d 100644 --- a/docker/testing/docker-compose.yml +++ b/docker/testing/docker-compose.yml @@ -1,39 +1,39 @@ services: ytdl-sub-gui: - image: ytdl-sub-gui:local - container_name: ytdl-sub-gui + image: "ytdl-sub-gui:local" + container_name: "ytdl-sub-gui" environment: - - PUID=1000 - - PGID=1000 - - TZ=America/Los_Angeles - - CRON_SCHEDULE="*/1 * * * *" - - CRON_RUN_ON_START=true + PUID: "1000" + PGID: "1000" + TZ: "America/Los_Angeles" + CRON_SCHEDULE: '"*/1 * * * *"' + CRON_RUN_ON_START: "true" volumes: - - ./volumes/ytdl-sub-gui:/config + - "./volumes/ytdl-sub-gui/:/config/" ports: - - 8443:8443 - restart: unless-stopped + - "8443:8443" + restart: "unless-stopped" ytdl-sub: - image: ytdl-sub:local - container_name: ytdl-sub + image: "ytdl-sub:local" + container_name: "ytdl-sub" environment: - - PUID=1000 - - PGID=1000 - - TZ=America/Los_Angeles - - CRON_SCHEDULE="*/1 * * * *" - - CRON_RUN_ON_START=true + PUID: "1000" + PGID: "1000" + TZ: "America/Los_Angeles" + CRON_SCHEDULE: '"*/1 * * * *"' + CRON_RUN_ON_START: "true" volumes: - - ./volumes/ytdl-sub:/config - restart: unless-stopped + - "./volumes/ytdl-sub/:/config/" + restart: "unless-stopped" ytdl-sub-ubuntu: - image: ytdl-sub-ubuntu:local - container_name: ytdl-sub-ubuntu + image: "ytdl-sub-ubuntu:local" + container_name: "ytdl-sub-ubuntu" environment: - - PUID=1000 - - PGID=1000 - - TZ=America/Los_Angeles - - CRON_SCHEDULE="*/1 * * * *" - - CRON_RUN_ON_START=true + PUID: "1000" + PGID: "1000" + TZ: "America/Los_Angeles" + CRON_SCHEDULE: '"*/1 * * * *"' + CRON_RUN_ON_START: "true" volumes: - - ./volumes/ytdl-sub:/config - restart: unless-stopped + - "./volumes/ytdl-sub/:/config/" + restart: "unless-stopped"