Skip to content

docs(admin): add Docker/AIO systemd example for the AI worker - #1

Merged
sanzakicesarr merged 1 commit into
masterfrom
docs/ai-worker-docker-systemd
Jun 16, 2026
Merged

docs(admin): add Docker/AIO systemd example for the AI worker#1
sanzakicesarr merged 1 commit into
masterfrom
docs/ai-worker-docker-systemd

Conversation

@sanzakicesarr

Copy link
Copy Markdown
Owner

The Systemd service section of the AI overview only documented running the task-processing worker on bare metal. When Nextcloud runs inside a Docker container (for example Nextcloud AIO) the service has to (a) wait for Docker and (b) call occ inside the container via docker exec. This adds that variant right after the existing systemd example:

  • extend the [Unit] section with After=network.target docker.service and Requires=docker.service, so the worker only starts once Docker is up;
  • a taskprocessing.sh that runs docker exec -i nextcloud-aio-nextcloud sudo -E -u www-data php occ taskprocessing:worker -v -t 60.

Using docker exec -i without -t is deliberate: systemd provides no pseudo-TTY, so -t would fail with the input device is not a TTY.

Notes for review:

  • The command mirrors the existing AIO docker exec example already in the Screen or tmux session section (same container name, user and command) and uses the current taskprocessing:worker command — the page documents (.. versionchanged:: 32.0.7) that this replaced background-job:worker.
  • Kept as plain prose + code blocks to match that existing Docker example on the same page, rather than a .. note::.
  • The two new code blocks carry explicit ini / bash language tags per the style guide ("always specify the language"); the surrounding pre-existing blocks are left untouched to keep the change focused.

✅ Resolves

🖼️ Screenshots

A screenshot of the rendered Systemd service section will follow later today. The change is a prose + two code-block addition; the diff and the description above show exactly what is added.

✅ Checklist

  • I have built the documentation locally and reviewed the output
  • Screenshots are included for visual changes (screenshot to follow later today)
  • I have not moved or renamed pages (or added a redirect if I did)
  • I have run codespell or similar and addressed any spelling issues

The "Systemd service" section only documented running the AI worker on
bare metal. When Nextcloud runs inside a Docker container (for example
Nextcloud AIO) the service has to wait for Docker and invoke occ inside
the container via docker exec.

Document extending the [Unit] section with a dependency on docker.service
and a taskprocessing.sh that uses "docker exec -i" without -t, since
systemd provides no pseudo-TTY. The command mirrors the existing AIO
docker exec example in the screen/tmux section and uses the current
taskprocessing:worker command.

Signed-off-by: Cesar <275373127+sanzakicesarr@users.noreply.github.com>
@sanzakicesarr
sanzakicesarr merged commit b0894da into master Jun 16, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a12832ec7b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +427 to +428
After=network.target docker.service
Requires=docker.service

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Add container readiness before starting the Docker worker

On a host boot or Docker restart, After=/Requires=docker.service only waits for the Docker daemon; it does not wait for nextcloud-aio-nextcloud to exist or be running. In that window the added docker exec exits immediately, and the inherited unit above has Restart=always with StartLimitInterval=60/StartLimitBurst=10; systemd.service(5) documents RestartSec= as defaulting to 100ms and systemd.unit(5) says hitting StartLimitBurst stops further restarts, so the worker can enter start-limit-hit before AIO finishes starting. Please add a container-readiness wait or a sufficient RestartSec=/container-specific dependency so the documented service survives normal boots.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Suggestion: Add systemd example for AI worker using Docker (docker exec) to documentation

1 participant