From e1ecb190bce911d00da05558fbd47939fa5b8383 Mon Sep 17 00:00:00 2001 From: openhands Date: Wed, 2 Sep 2026 12:58:39 +0200 Subject: [PATCH] docs(docker): clarify how to update (nightly cron + manual run) in README --- README.md | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 2d91ca3e..cbe7de70 100644 --- a/README.md +++ b/README.md @@ -156,26 +156,33 @@ The CMS will be available at `http://localhost:3002`. ### Automatic Updates -A cron-safe update script is included: `scripts/docker-update.sh`. It pulls the -latest `main`, runs CMS migrations on the host, rebuilds the image, recreates the -container, waits for a healthy status, and makes sure the stale host-side PM2 CMS -(`pm2 stop next`) stays stopped so it can't clash on port 3002. +Updating is fully scripted — no need to touch Docker or nginx by hand. The +script `scripts/docker-update.sh` pulls the latest `main`, runs CMS migrations +on the host, rebuilds the image, recreates the container and waits for a healthy +status. It also makes sure a stale host-side PM2 CMS (`pm2 stop next`) stays +stopped so it can't clash on port 3002. -```bash -./scripts/docker-update.sh # run once manually -# log: logs/docker-update.log -``` - -Set it up as a nightly cron job (03:30 example): +**Automatically (recommended):** a nightly cron job is already configured on a +production server that installed this setup. It runs the script every night at +03:30 and appends to `logs/docker-update.cron.log`: ```bash crontab -e # 30 3 * * * /var/www/atom-nexst/scripts/docker-update.sh >> /var/www/atom-nexst/logs/docker-update.cron.log 2>&1 ``` +**Manually** — to update right now (same steps as the cron runs): + +```bash +cd /var/www/atom-nexst +./scripts/docker-update.sh +# log: logs/docker-update.log +``` + The script aborts safely (exit 1) if the working tree has uncommitted changes so a `git pull` can never clobber local edits, and leaves the container running if -health fails so you can debug it (exit 3). +health fails so you can debug it (exit 3). Failed runs are reported in the log; +an exit of 0 means the CMS is healthy on the new commit. ### Docker Commands