Files
composes/code-server
tiennm99 ac00eb9674 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.
2026-09-18 10:47:56 +07:00
..

code-server

VS Code in the browser, from the LinuxServer image, set up as a full remote dev box.

Comes with Go, Node.js 24, Python 3, and zsh via LinuxServer mods, plus gh, git, glab, unzip and zip through INSTALL_PACKAGES. Git author/committer identity is injected from .env.

Docker access

The universal-docker mod installs the Docker CLI but no daemon, so the host socket is bind-mounted at /var/run/docker.sock to give it something to talk to. Containers started from inside are siblings on the host, not children -- bind mounts in them resolve against host paths, so a path under /config will not exist unless the same path exists on the host.

The socket is owned by the host's docker group, which the abc user inside the container is not a member of; run docker under sudo (the SUDO_PASSWORD is the same PASSWORD) or add the group by hand. Handing a container the socket is equivalent to giving it root on the host -- that is accepted here because this is a single-user dev box.

Environment

Variable Purpose
SERVICE_HOSTNAME Container hostname, and the name the shell prompt shows.
PASSWORD Web UI login, also the in-container sudo password. A blank value disables authentication entirely.
GIT_NAME / GIT_EMAIL Git author and committer identity

Generate a password with openssl rand -base64 24.

SERVICE_HOSTNAME is used twice: as the container's hostname: and as the HOST variable inside it. Coolify injects HOST=0.0.0.0 into every compose app, and zsh seeds $HOST and the %m/%M prompt escapes from that variable rather than calling gethostname() -- so the prompt reads 0, the first dot-separated field of 0.0.0.0. code-server itself never reads HOST -- it binds [::]:8443 -- so overriding it only affects the prompt. bash is unaffected; its \h uses the real hostname.

It is not called HOSTNAME, the obvious name, because Compose interpolation lets the deploying shell's environment win over the .env file, and HOSTNAME is set in every container -- including the one Coolify itself runs in. The container would silently take Coolify's hostname instead of this value.

Networking

Listens on 8443. No ports are published — point the domain at that port in Coolify or Dokploy. See the root README for why.

Storage

Everything lives in the code-server-config named volume mounted at /config; the default workspace is /config/workspace. Removing the volume wipes your files, settings, and extensions.