Skip to content

Commit 2ef9946

Browse files
committed
z0 - startCommands user
1 parent 010c3b8 commit 2ef9946

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

‎apps/docs/content/zerops-yaml/specification.mdx‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,24 @@ run:
438438
- litestream restore -if-replica-exists -if-db-not-exists -config=litestream.yaml $DB_NAME
439439
```
440440

441+
Each entry supports:
442+
443+
- `command` (required) - the command to run
444+
- `name` (optional) - distinguishes the process in logs
445+
- `workingDir` (optional, default `/var/www`) - the directory the command and its `initCommands` run in
446+
- `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`.
447+
- `initCommands` (optional) - commands run before this process starts, each time a container starts or restarts
448+
449+
```yaml
450+
run:
451+
prepareCommands:
452+
- sudo adduser --system --group --home /home/git git
453+
startCommands:
454+
- command: gitea web
455+
name: gitea
456+
user: git
457+
```
458+
441459
See [start-commands-example](https://github.com/zeropsio/start-commands-example)
442460

443461
### documentRoot <Badge type="optional" />
@@ -492,6 +510,10 @@ Files or directories to process for variable replacement.
492510
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.
493511
:::
494512

513+
:::info
514+
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.
515+
:::
516+
495517
**How it works:**
496518
1. Define placeholders in your files using the specified delimiters
497519
2. Set environment variables with matching names

0 commit comments

Comments
 (0)