This commit is contained in:
parent
67c8df29e0
commit
80c79cd779
|
|
@ -55,6 +55,10 @@ COPY --from=builder /app/apps/blogai/public ./public
|
||||||
COPY --from=builder /app/apps/blogai/next.config.js ./next.config.js
|
COPY --from=builder /app/apps/blogai/next.config.js ./next.config.js
|
||||||
COPY --from=builder /app/apps/blogai/next-i18next.config.js ./next-i18next.config.js
|
COPY --from=builder /app/apps/blogai/next-i18next.config.js ./next-i18next.config.js
|
||||||
|
|
||||||
|
# 确保 wrapper.sh 可执行权限
|
||||||
|
COPY ./wrapper.sh /plugai/wrapper.sh
|
||||||
|
RUN chmod +x /plugai/wrapper.sh
|
||||||
|
|
||||||
RUN rm -rf /root/.npm /root/.pnpm-store /tmp/*
|
RUN rm -rf /root/.npm /root/.pnpm-store /tmp/*
|
||||||
|
|
||||||
EXPOSE 3008
|
EXPOSE 3008
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,20 @@
|
||||||
[web]
|
[supervisord]
|
||||||
command=npm start
|
nodaemon=true
|
||||||
|
logfile=/tmp/supervisord.log
|
||||||
|
pidfile=/tmp/supervisord.pid
|
||||||
|
|
||||||
|
[unix_http_server]
|
||||||
|
file=/var/run/supervisor.sock
|
||||||
|
chmod=0700
|
||||||
|
|
||||||
|
[rpcinterface:supervisor]
|
||||||
|
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
|
||||||
|
|
||||||
|
[supervisorctl]
|
||||||
|
serverurl=unix:///var/run/supervisor.sock
|
||||||
|
|
||||||
|
[program:web]
|
||||||
|
command=/plugai/wrapper.sh
|
||||||
directory=/plugai/zerostack/t1
|
directory=/plugai/zerostack/t1
|
||||||
autostart=true
|
autostart=true
|
||||||
autorestart=true
|
autorestart=true
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,25 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
|
||||||
|
# ✅ 设置 SUPABASE_URL,如果为空则使用默认值
|
||||||
|
if [ -z "${SUPABASE_URL:-}" ]; then
|
||||||
|
SUPABASE_URL="http://localhost:8000"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# ✅ 删除旧的 env.js(如果存在)
|
||||||
|
ENV_FILE="/supabase/chatdesk/public/env.js"
|
||||||
|
if [ -f "$ENV_FILE" ]; then
|
||||||
|
echo "[chatdesk-ui] Removing old env.js"
|
||||||
|
rm -f "$ENV_FILE"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# ✅ 写入新的 env.js
|
||||||
|
echo "[chatdesk-ui] Writing env.js with SUPABASE_URL=$SUPABASE_URL"
|
||||||
|
cat <<EOF > "$ENV_FILE"
|
||||||
|
window.RUNTIME_ENV = {
|
||||||
|
"SUPABASE_URL": "${SUPABASE_URL}"
|
||||||
|
};
|
||||||
|
EOF
|
||||||
|
|
||||||
|
cd /plugai/zerostack/t1
|
||||||
|
exec npm run start
|
||||||
Loading…
Reference in New Issue