style: order environment variables by how much the service needs them

environment: blocks were in no particular order. They now run must-have ->
should-have -> optional, with related variables kept adjacent as a group that
takes the tier of its most important member: PUID/PGID, PASSWORD with
SUDO_PASSWORD, DOCKER_MODS ahead of the INSTALL_PACKAGES and
NODEJS_MOD_VERSION that configure it, the four GIT_* entries, the PASEO_*
daemon settings.

Each .env.example is reordered to match its compose file. The names do not map
one to one -- PASSWORD feeds both PASSWORD and SUDO_PASSWORD, SERVICE_HOSTNAME
feeds HOST -- so an entry sits where the first compose entry reading it sits.

The HOST comment in both compose files is dropped; the READMEs already carry
that explanation in full. CLAUDE.md records the ordering convention.

alloy and gitea-mirror-local are untouched: every variable there is required,
so the tiers collapse and the existing grouping is the better one.
This commit is contained in:
tiennm99 committed 2026-09-18 10:47:56 +07:00
1 parent ea46992e64
commit ac00eb9674
6 files changed
+53 -25

No files matched your search

+4 -4
View File
@@ -2,10 +2,6 @@
#
# cp .env.example .env
# Container hostname, also passed in as HOST -- the name zsh's prompt shows.
# Not named HOSTNAME: the deploying shell's own HOSTNAME would override it.
SERVICE_HOSTNAME=code-server
# Web UI login password. MUST NOT be blank -- the LinuxServer image serves
# code-server without authentication when PASSWORD is empty.
# Also used for SUDO_PASSWORD inside the container.
@@ -15,3 +11,7 @@ PASSWORD=
# Git identity baked into the container (author + committer).
GIT_NAME=
GIT_EMAIL=
# Container hostname, also passed in as HOST -- the name zsh's prompt shows.
# Not named HOSTNAME: the deploying shell's own HOSTNAME would override it.
SERVICE_HOSTNAME=code-server
+6 -7
View File
@@ -5,20 +5,19 @@ services:
environment:
- PUID=1000
- PGID=1000
- TZ=Asia/Ho_Chi_Minh
# Hostname zsh's prompt reads, overriding the one Coolify injects.
- HOST=${SERVICE_HOSTNAME}
- DEFAULT_WORKSPACE=/config/workspace
- PWA_APPNAME=code-server
- PASSWORD=${PASSWORD}
- SUDO_PASSWORD=${PASSWORD}
- 'DOCKER_MODS=linuxserver/mods:universal-package-install|linuxserver/mods:universal-docker|linuxserver/mods:code-server-golang|linuxserver/mods:code-server-nodejs|linuxserver/mods:code-server-npmglobal|linuxserver/mods:code-server-python3|linuxserver/mods:code-server-zsh'
- INSTALL_PACKAGES=gh|git|glab|unzip|zip
- NODEJS_MOD_VERSION=24
- PASSWORD=${PASSWORD}
- SUDO_PASSWORD=${PASSWORD}
- TZ=Asia/Ho_Chi_Minh
- DEFAULT_WORKSPACE=/config/workspace
- GIT_AUTHOR_NAME=${GIT_NAME}
- GIT_AUTHOR_EMAIL=${GIT_EMAIL}
- GIT_COMMITTER_NAME=${GIT_NAME}
- GIT_COMMITTER_EMAIL=${GIT_EMAIL}
- HOST=${SERVICE_HOSTNAME}
- PWA_APPNAME=code-server
volumes:
- 'code-server-config:/config'
- '/var/run/docker.sock:/var/run/docker.sock'