From 5b64544e91d7acdaf845f8fdee4ffa8c75389399 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C4=9Bj=20Pavl=C3=AD=C4=8Dek?= Date: Thu, 3 Sep 2026 17:01:11 +0200 Subject: [PATCH] z0 - startCommands user --- .../content/zerops-yaml/specification.mdx | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/apps/docs/content/zerops-yaml/specification.mdx b/apps/docs/content/zerops-yaml/specification.mdx index 87bdcfbd..7c723afd 100644 --- a/apps/docs/content/zerops-yaml/specification.mdx +++ b/apps/docs/content/zerops-yaml/specification.mdx @@ -438,6 +438,24 @@ run: - litestream restore -if-replica-exists -if-db-not-exists -config=litestream.yaml $DB_NAME ``` +Each entry supports: + +- `command` (required) - the command to run +- `name` (optional) - distinguishes the process in logs +- `workingDir` (optional, default `/var/www`) - the directory the command and its `initCommands` run in +- `user` (optional, default `zerops`) - the system user the command and its `initCommands` run under. The user has to exist in the runtime container, create it in `prepareCommands`. +- `initCommands` (optional) - commands run before this process starts, each time a container starts or restarts + +```yaml +run: + prepareCommands: + - sudo adduser --system --group --home /home/git git + startCommands: + - command: gitea web + name: gitea + user: git +``` + See [start-commands-example](https://github.com/zeropsio/start-commands-example) ### documentRoot @@ -492,6 +510,10 @@ Files or directories to process for variable replacement. Directory targets only process files directly in the specified directory, not subdirectories for performance reasons. To process files in subdirectories, specify each subdirectory explicitly in the target array. For example, ./config/ processes only files in the config directory itself, not files in ./config/jwt/ or other subdirectories. ::: +:::info +Not to be confused with the [`zsc env-replace`](/references/zsc#env-replace) command, which renders `{{.VARIABLE}}` Go templates from a source path into a separate target path and can be run from `initCommands` or manually. +::: + **How it works:** 1. Define placeholders in your files using the specified delimiters 2. Set environment variables with matching names