Files
autoclip/docker-dev-entrypoint.sh
Kris K 7fd70c9919 refactor: 整理旧运维入口与过时仓库文档 (#245)
* refactor: consolidate repository launchers and retire stale tooling

* test: wait for source smoke broker and correct desktop entry docs

* chore: exclude runtime PID metadata from repository and images
2026-09-30 21:43:41 +08:00

28 lines
913 B
Bash
Executable File

#!/usr/bin/env bash
# Run the two development servers; worker runs in its own Compose service.
set -euo pipefail
cd /app
export PATH="/app/venv/bin:$PATH"
python init_database.py
# Compose isolates Linux dependencies from a host's macOS/Windows node_modules.
# npm ci checks the lock file and never rewrites package manifests.
(cd frontend && npm ci)
python -m uvicorn backend.main:app --host 0.0.0.0 --port 8000 --reload --reload-dir backend &
API_PID=$!
(cd frontend && exec npm run dev -- --host 0.0.0.0 --port 3000 --strictPort) &
WEB_PID=$!
cleanup() {
kill "$API_PID" "$WEB_PID" 2>/dev/null || true
wait "$API_PID" "$WEB_PID" 2>/dev/null || true
}
trap cleanup EXIT
trap 'exit 130' INT
trap 'exit 143' TERM
# If either server exits, stop its sibling and let Compose restart the service.
set +e
wait -n "$API_PID" "$WEB_PID"
RESULT=$?
set -e
if [[ "$RESULT" == 0 ]]; then RESULT=1; fi
exit "$RESULT"