tenfyzhong commited on
Commit
d1a336d
·
unverified ·
1 Parent(s): e7654ec

feat(gateway): add restart helper script (#21)

Browse files

Add a gateway restart helper script and include it in the image.\nAlso document the script in README and set container WORKDIR to /root.

Signed-off-by: tenfyzhong <tenfy@tenfy.cn>

Files changed (3) hide show
  1. Dockerfile +3 -2
  2. README.md +1 -0
  3. scripts/openclaw-gateway-restart +2 -0
Dockerfile CHANGED
@@ -136,14 +136,15 @@ RUN HOME=/root /bin/bash -lc "curl -sSf https://sshx.io/get | sh" && \
136
  if [ -x /root/.local/bin/sshx ]; then ln -sf /root/.local/bin/sshx /usr/local/bin/sshx; fi && \
137
  sshx --help >/dev/null
138
 
139
- WORKDIR /opt/openclaw-hf
140
 
141
  COPY openclaw_hf /opt/openclaw-hf/openclaw_hf
142
  COPY scripts/openclaw-entrypoint.sh /usr/local/bin/openclaw-entrypoint.sh
143
  COPY scripts/openclaw-backup-cron.sh /usr/local/bin/openclaw-backup-cron.sh
144
  COPY scripts/openclaw-restore.sh /usr/local/bin/openclaw-restore.sh
 
145
 
146
- RUN chmod 755 /usr/local/bin/openclaw-entrypoint.sh /usr/local/bin/openclaw-backup-cron.sh /usr/local/bin/openclaw-restore.sh && \
147
  mkdir -p /root/.openclaw/workspace /var/log/openclaw
148
 
149
  ENV NODE_ENV=production
 
136
  if [ -x /root/.local/bin/sshx ]; then ln -sf /root/.local/bin/sshx /usr/local/bin/sshx; fi && \
137
  sshx --help >/dev/null
138
 
139
+ WORKDIR /root
140
 
141
  COPY openclaw_hf /opt/openclaw-hf/openclaw_hf
142
  COPY scripts/openclaw-entrypoint.sh /usr/local/bin/openclaw-entrypoint.sh
143
  COPY scripts/openclaw-backup-cron.sh /usr/local/bin/openclaw-backup-cron.sh
144
  COPY scripts/openclaw-restore.sh /usr/local/bin/openclaw-restore.sh
145
+ COPY scripts/openclaw-gateway-restart /usr/local/bin/openclaw-gateway-restart
146
 
147
+ RUN chmod 755 /usr/local/bin/openclaw-entrypoint.sh /usr/local/bin/openclaw-backup-cron.sh /usr/local/bin/openclaw-restore.sh /usr/local/bin/openclaw-gateway-restart && \
148
  mkdir -p /root/.openclaw/workspace /var/log/openclaw
149
 
150
  ENV NODE_ENV=production
README.md CHANGED
@@ -27,6 +27,7 @@ This setup is designed to provide the following:
27
  - `openclaw_hf/backup.py`: Backup/restore implementation
28
  - `scripts/openclaw-backup-cron.sh`: Cron entrypoint for backup jobs
29
  - `scripts/openclaw-restore.sh`: Startup restore entrypoint
 
30
  - `scripts/bootstrap-hf.sh`: Interactive bootstrap for Space/Dataset creation, upload, and Space variables/secrets setup (macOS/Linux)
31
  - `scripts/bootstrap-hf.ps1`: Interactive bootstrap for Space/Dataset creation, upload, and Space variables/secrets setup (Windows PowerShell)
32
  - `tests/test_backup.py`: Unit tests for the backup module
 
27
  - `openclaw_hf/backup.py`: Backup/restore implementation
28
  - `scripts/openclaw-backup-cron.sh`: Cron entrypoint for backup jobs
29
  - `scripts/openclaw-restore.sh`: Startup restore entrypoint
30
+ - `scripts/openclaw-gateway-restart`: Kill running `openclaw-gateway` processes
31
  - `scripts/bootstrap-hf.sh`: Interactive bootstrap for Space/Dataset creation, upload, and Space variables/secrets setup (macOS/Linux)
32
  - `scripts/bootstrap-hf.ps1`: Interactive bootstrap for Space/Dataset creation, upload, and Space variables/secrets setup (Windows PowerShell)
33
  - `tests/test_backup.py`: Unit tests for the backup module
scripts/openclaw-gateway-restart ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ #!/usr/bin/env bash
2
+ ps -ef | grep openclaw-gateway | grep -v grep | awk '{print $2}' | xargs -I {} kill {}