Dmitry Beresnev commited on
Commit ·
b83cb91
1
Parent(s): ed61236
add supervisord
Browse filesFiles changed (3)
- Dockerfile+3-4
- app.py+11-1
- supervisord.conf+10-1
12345 unmodified lines10111213141525 unmodified lines414243444546FROM python:3.13-slimWORKDIR /app5 unmodified linescaddy \ffmpeg \git \&& curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \&& apt-get install -y --no-install-recommends nodejs \&& npm install -g openclaw \25 unmodified linesEXPOSE 7860# CMD ["sh", "-c", "( while true; do ${OPENCLAW_BIN} gateway run --port ${OPENCLAW_PORT} --bind loopback --allow-unconfigured --dev --verbose || ${OPENCLAW_BIN} gateway --port ${OPENCLAW_PORT} --bind loopback --allow-unconfigured --dev --verbose; echo \"[gateway] exited with $?; restarting in 2s\"; sleep 2; done ) > /tmp/openclaw-gateway.log 2> /tmp/openclaw-gateway.err.log & uv run streamlit run app.py --server.address=0.0.0.0 --server.port=8501 > /tmp/streamlit.log 2>&1 & exec caddy run --config /app/Caddyfile --adapter caddyfile"]CMD ["sh", "-c", "( while true; do echo '[gateway] starting...' >> /tmp/openclaw-gateway.log; ${OPENCLAW_BIN} gateway run --port ${OPENCLAW_PORT} --allow-unconfigured >> /tmp/openclaw-gateway.log 2>> /tmp/openclaw-gateway.err.log; echo \"[gateway] exited $?; restarting in 3s\" >> /tmp/openclaw-gateway.log; sleep 3; done ) & uv run streamlit run app.py --server.address=0.0.0.0 --server.port=8501 >> /tmp/streamlit.log 2>> /tmp/streamlit.err.log & exec caddy run --config /app/Caddyfile --adapter caddyfile"]12345 unmodified lines1011121314151625 unmodified lines42434445FROM python:3.11-slimWORKDIR /app5 unmodified linescaddy \ffmpeg \git \supervisor \&& curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \&& apt-get install -y --no-install-recommends nodejs \&& npm install -g openclaw \25 unmodified linesEXPOSE 7860CMD ["supervisord", "-c", "/app/supervisord.conf"]
35 unmodified lines36373839404142453 unmodified lines49649749849950050150250350450550650750850951035 unmodified linesOPENCLAW_PROXY_LOCAL_URL = os.getenv("OPENCLAW_PROXY_LOCAL_URL", "http://127.0.0.1:7860/openclaw/")SUPERVISOR_LOG_PATH = Path("/tmp/supervisord.log")STREAMLIT_ERR_LOG_PATH = Path("/tmp/streamlit.err.log")CADDY_ERR_LOG_PATH = Path("/tmp/caddy.err.log")def resolve_openclaw_bin() -> str | None:453 unmodified linesst.subheader("Gateway Logs")st.code("\n".join(st.session_state["gateway_logs"][-LOG_MAX_LINES:]) or "No logs yet.")st.expander("Service Diagnostics (Supervisor/Caddy/Streamlit)").code("\n\n".join(["=== supervisord.log ===",tail_text_file(SUPERVISOR_LOG_PATH),"=== caddy.err.log ===",tail_text_file(CADDY_ERR_LOG_PATH),"=== streamlit.err.log ===",tail_text_file(STREAMLIT_ERR_LOG_PATH),]))35 unmodified lines363738394041424344453 unmodified lines49849950050150250350450550650750850951051151251351451551651751851952035 unmodified linesOPENCLAW_PROXY_LOCAL_URL = os.getenv("OPENCLAW_PROXY_LOCAL_URL", "http://127.0.0.1:7860/openclaw/")SUPERVISOR_LOG_PATH = Path("/tmp/supervisord.log")STREAMLIT_ERR_LOG_PATH = Path("/tmp/streamlit.err.log")STREAMLIT_LOG_PATH = Path("/tmp/streamlit.log")CADDY_ERR_LOG_PATH = Path("/tmp/caddy.err.log")CADDY_LOG_PATH = Path("/tmp/caddy.log")def resolve_openclaw_bin() -> str | None:453 unmodified linesst.subheader("Gateway Logs")st.code("\n".join(st.session_state["gateway_logs"][-LOG_MAX_LINES:]) or "No logs yet.")st.expander("Service Diagnostics (Supervisor/Caddy/Streamlit/OpenClaw)").code("\n\n".join(["=== supervisord.log ===",tail_text_file(SUPERVISOR_LOG_PATH),"=== openclaw-gateway.err.log ===",tail_text_file(GATEWAY_ERR_LOG_PATH),"=== openclaw-gateway.log ===",tail_text_file(GATEWAY_BOOT_LOG_PATH),"=== caddy.err.log ===",tail_text_file(CADDY_ERR_LOG_PATH),"=== caddy.log ===",tail_text_file(CADDY_LOG_PATH),"=== streamlit.err.log ===",tail_text_file(STREAMLIT_ERR_LOG_PATH),"=== streamlit.log ===",tail_text_file(STREAMLIT_LOG_PATH),]))
4 unmodified lines56789101112132 unmodified lines1617181920211 unmodified line23242526274 unmodified linesuser=root[program:openclaw]command=/bin/sh -lc "openclaw gateway run --port 18789 --bind loopback --allow-unconfigured --dev --verbose"autorestart=truestartsecs=5stdout_logfile=/tmp/openclaw-gateway.logstderr_logfile=/tmp/openclaw-gateway.err.logenvironment=HOME="/root"2 unmodified linescommand=/bin/sh -lc "cd /app && uv run streamlit run app.py --server.address=0.0.0.0 --server.port=8501"autorestart=truestartsecs=2stdout_logfile=/tmp/streamlit.logstderr_logfile=/tmp/streamlit.err.log1 unmodified linecommand=/bin/sh -lc "caddy run --config /app/Caddyfile --adapter caddyfile"autorestart=truestartsecs=2stdout_logfile=/tmp/caddy.logstderr_logfile=/tmp/caddy.err.log4 unmodified lines56789101112131415162 unmodified lines1920212223242526271 unmodified line29303132333435364 unmodified linesuser=root[program:openclaw]command=/bin/sh -lc "openclaw gateway run --port 18789 --allow-unconfigured"autorestart=truestartsecs=5startretries=20stopasgroup=truekillasgroup=truestdout_logfile=/tmp/openclaw-gateway.logstderr_logfile=/tmp/openclaw-gateway.err.logenvironment=HOME="/root"2 unmodified linescommand=/bin/sh -lc "cd /app && uv run streamlit run app.py --server.address=0.0.0.0 --server.port=8501"autorestart=truestartsecs=2startretries=20stopasgroup=truekillasgroup=truestdout_logfile=/tmp/streamlit.logstderr_logfile=/tmp/streamlit.err.log1 unmodified linecommand=/bin/sh -lc "caddy run --config /app/Caddyfile --adapter caddyfile"autorestart=truestartsecs=2startretries=20stopasgroup=truekillasgroup=truestdout_logfile=/tmp/caddy.logstderr_logfile=/tmp/caddy.err.log
Dockerfile+3-4
app.py+11-1
supervisord.conf+10-1