jkes6203 commited on
Commit
d210f22
·
1 Parent(s): 3f23aed

Add entrypoint startup step logs

Browse files
Files changed (1) hide show
  1. Dockerfile +29 -3
Dockerfile CHANGED
@@ -30,27 +30,53 @@ EXPOSE 7860
30
  RUN printf '%s\n' \
31
  '#!/bin/sh' \
32
  'set -e' \
 
 
 
 
 
 
 
 
 
 
 
 
33
  'if mkdir -p /data/.openclaw 2>/dev/null; then' \
34
  ' export OPENCLAW_HOME=/data' \
35
  'else' \
36
  ' export OPENCLAW_HOME=/home/user' \
37
  ' mkdir -p /home/user/.openclaw' \
38
  'fi' \
 
39
  'if [ -n "${OPENCLAW_TELEGRAM_PROXY}" ]; then' \
40
  ' export HTTPS_PROXY="${HTTPS_PROXY:-$OPENCLAW_TELEGRAM_PROXY}"' \
41
  ' export HTTP_PROXY="${HTTP_PROXY:-$OPENCLAW_TELEGRAM_PROXY}"' \
42
  ' export ALL_PROXY="${ALL_PROXY:-$OPENCLAW_TELEGRAM_PROXY}"' \
 
43
  'fi' \
44
- 'node /app/resolve-telegram-host.mjs || true' \
 
45
  'node /app/setup-hf-config.mjs' \
 
 
46
  'node /app/import-auth-profiles.mjs' \
47
- 'node /app/startup-notify.mjs || true' \
 
48
  'if [ "${OPENCLAW_ENABLE_GEMINI_CLI_AUTH:-1}" = "1" ]; then' \
49
- ' openclaw plugins enable google-gemini-cli-auth >/tmp/openclaw-gemini-cli.log 2>&1 || true' \
 
 
 
 
 
 
50
  'fi' \
51
  'if [ -n "${SUPABASE_URL}" ] && [ -n "${SUPABASE_KEY}" ]; then' \
 
52
  ' node /app/sync-external-storage.mjs 2>&1 &' \
53
  'fi' \
 
54
  'exec openclaw gateway --allow-unconfigured --bind lan --port 7860 "$@"' \
55
  > /app/entrypoint.sh \
56
  && chmod +x /app/entrypoint.sh
 
30
  RUN printf '%s\n' \
31
  '#!/bin/sh' \
32
  'set -e' \
33
+ 'run_optional() {' \
34
+ ' step="$1"' \
35
+ ' shift' \
36
+ ' echo "[openclaw-entrypoint] step=${step} status=start"' \
37
+ ' if "$@"; then' \
38
+ ' echo "[openclaw-entrypoint] step=${step} status=ok"' \
39
+ ' else' \
40
+ ' code=$?' \
41
+ ' echo "[openclaw-entrypoint] step=${step} status=failed exit=${code} (continuing)"' \
42
+ ' fi' \
43
+ '}' \
44
+ 'echo "[openclaw-entrypoint] status=start node=$(node --version 2>/dev/null || echo missing) openclaw=$(openclaw --version 2>/dev/null || echo missing)"' \
45
  'if mkdir -p /data/.openclaw 2>/dev/null; then' \
46
  ' export OPENCLAW_HOME=/data' \
47
  'else' \
48
  ' export OPENCLAW_HOME=/home/user' \
49
  ' mkdir -p /home/user/.openclaw' \
50
  'fi' \
51
+ 'echo "[openclaw-entrypoint] openclaw_home=${OPENCLAW_HOME}"' \
52
  'if [ -n "${OPENCLAW_TELEGRAM_PROXY}" ]; then' \
53
  ' export HTTPS_PROXY="${HTTPS_PROXY:-$OPENCLAW_TELEGRAM_PROXY}"' \
54
  ' export HTTP_PROXY="${HTTP_PROXY:-$OPENCLAW_TELEGRAM_PROXY}"' \
55
  ' export ALL_PROXY="${ALL_PROXY:-$OPENCLAW_TELEGRAM_PROXY}"' \
56
+ ' echo "[openclaw-entrypoint] telegram_proxy=1"' \
57
  'fi' \
58
+ 'run_optional resolve-telegram-host node /app/resolve-telegram-host.mjs' \
59
+ 'echo "[openclaw-entrypoint] step=setup-hf-config status=start"' \
60
  'node /app/setup-hf-config.mjs' \
61
+ 'echo "[openclaw-entrypoint] step=setup-hf-config status=ok"' \
62
+ 'echo "[openclaw-entrypoint] step=import-auth-profiles status=start"' \
63
  'node /app/import-auth-profiles.mjs' \
64
+ 'echo "[openclaw-entrypoint] step=import-auth-profiles status=ok"' \
65
+ 'run_optional startup-notify node /app/startup-notify.mjs' \
66
  'if [ "${OPENCLAW_ENABLE_GEMINI_CLI_AUTH:-1}" = "1" ]; then' \
67
+ ' echo "[openclaw-entrypoint] step=enable-gemini-cli-auth status=start"' \
68
+ ' if openclaw plugins enable google-gemini-cli-auth >/tmp/openclaw-gemini-cli.log 2>&1; then' \
69
+ ' echo "[openclaw-entrypoint] step=enable-gemini-cli-auth status=ok log=/tmp/openclaw-gemini-cli.log"' \
70
+ ' else' \
71
+ ' code=$?' \
72
+ ' echo "[openclaw-entrypoint] step=enable-gemini-cli-auth status=failed exit=${code} log=/tmp/openclaw-gemini-cli.log (continuing)"' \
73
+ ' fi' \
74
  'fi' \
75
  'if [ -n "${SUPABASE_URL}" ] && [ -n "${SUPABASE_KEY}" ]; then' \
76
+ ' echo "[openclaw-entrypoint] step=sync-external-storage status=start background=1"' \
77
  ' node /app/sync-external-storage.mjs 2>&1 &' \
78
  'fi' \
79
+ 'echo "[openclaw-entrypoint] step=gateway status=exec port=7860 bind=lan"' \
80
  'exec openclaw gateway --allow-unconfigured --bind lan --port 7860 "$@"' \
81
  > /app/entrypoint.sh \
82
  && chmod +x /app/entrypoint.sh