services.yaml defines processes that run inside the worker container. It does not select the container image or perform deployment.
Use this when you need to:
- Define one or more long-running services inside the container.
- Configure commands, restart policy, and env vars for each service.
- Runtime-only: it lives inside the container at
/home/udx/.config/worker/. - Image selection happens at deployment time (see
docs/deploy/README.md). - Each service is configured with a single
commandstring (there is noargsfield inservices.yaml).
kind: workerService
version: udx.io/worker-v1/service
services:
- name: "web-server"
command: "python app.py"
autostart: true
autorestart: true
envs:
- "PORT=8080"
- "DEBUG=true"kind: workerService
version: udx.io/worker-v1/service
services:
- name: "logger"
command: >-
bash -lc 'echo "[startup] logger";
while true; do echo "[tick] $(date)"; sleep 5; done'
autostart: true
autorestart: trueThen view output:
worker service logs logger --tail 100 --follow
worker service errors logger --tail 100 --followExample scripts: src/examples/simple-service/
kind: workerService
version: udx.io/worker-v1/service
services:
- name: "serviceA"
command: >-
bash -lc 'echo "starting $SERVICE_NAME"; exec /home/udx/bin/service_a.sh'
autostart: true
autorestart: true
envs:
- "SERVICE_NAME=serviceA"
- "LOG_LEVEL=info"
- name: "serviceB"
command: >-
bash -lc 'echo "starting $SERVICE_NAME"; exec /home/udx/bin/service_b.sh'
autostart: true
autorestart: true
envs:
- "SERVICE_NAME=serviceB"
- "LOG_LEVEL=warn"kind: workerService
version: udx.io/worker-v1/service
services:
- name: "job-runner"
command: >-
/home/udx/bin/job-runner.sh
--config-path=/etc/app/config.json
--mode=sync
--retry=3
autostart: true
autorestart: truekind: workerService
version: udx.io/worker-v1/service
services:
- name: "print-service-name"
command: >-
bash -lc 'echo "SERVICE_NAME=$SERVICE_NAME"; exec /home/udx/bin/start.sh'
autostart: true
autorestart: true
envs:
- "SERVICE_NAME=worker-api"- Using
services.yamlto select the image (usedeploy.ymlinstead). - Forgetting to mount
services.yamlinto the container. - Expecting an
argsfield inservices.yaml(put arguments directly incommand). - Putting provider references (for example
azure/...) inservices.yamlenvs.
docs/runtime/config.mddocs/deploy/README.md