fix: use PORT env var and cargo watch for backend in system prompt

Change backend start command to use PORT= instead of --port flag and
cargo watch for auto-reload. Install cargo-watch in sandbox container.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
centdix
2026-02-21 18:59:11 +00:00
co-authored by Claude Opus 4.6
parent ed1a655317
commit 24f2571b37
2 changed files with 4 additions and 2 deletions
+3 -1
View File
@@ -41,9 +41,11 @@ RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | \
chmod -R a+rwX /opt/rustup /opt/cargo && \
ln -s /opt/cargo/bin/* /usr/local/bin/
# Install sqlx-cli (for database migrations)
# Install sqlx-cli (for database migrations) and cargo-watch (for auto-reload)
RUN cargo install sqlx-cli --no-default-features --features native-tls,postgres && \
cargo install cargo-watch && \
ln -sf /opt/cargo/bin/sqlx /usr/local/bin/sqlx && \
ln -sf /opt/cargo/bin/cargo-watch /usr/local/bin/cargo-watch && \
chmod -R a+rwX /opt/cargo
# Embed network init script (sets up iptables firewall, then drops privileges)
+1 -1
View File
@@ -93,7 +93,7 @@ function buildSystemPrompt(profile: Profile, env: Record<string, string>): strin
}
lines.push(`This worktree is configured with the following ports:`);
lines.push(`- Backend: port ${backendPort}. Start with: cd backend && DATABASE_URL=postgres://postgres:changeme@localhost:5432/windmill cargo run -- --port ${backendPort}`);
lines.push(`- Backend: port ${backendPort}. Start with: cd backend && PORT=${backendPort} DATABASE_URL=postgres://postgres:changeme@localhost:5432/windmill cargo watch -x run`);
lines.push(`- Frontend: port ${frontendPort}. Start with: cd frontend && REMOTE=http://localhost:${backendPort} npm run dev -- --port ${frontendPort} --host 0.0.0.0`);
return lines.join(" ");