- Add processed/ ML features and GCN model inputs - Add Outputs/ GIS analysis, deploy configs, lit review - Add proposal document for 湖北省卫生健康科技项目 - Enable full data portability for cross-machine development
31 lines
825 B
Bash
Executable File
31 lines
825 B
Bash
Executable File
#!/bin/bash
|
|
set -e
|
|
|
|
echo "=== CBPOA Backend Deployment ==="
|
|
|
|
INSTALL_DIR=/opt/cbpoa/backend
|
|
|
|
# Copy backend files
|
|
sudo mkdir -p $INSTALL_DIR
|
|
sudo cp -r . $INSTALL_DIR/
|
|
|
|
# Fix venv shebangs (hardcoded to build machine path)
|
|
echo "Fixing venv shebangs..."
|
|
VENV_PYTHON="$INSTALL_DIR/venv/bin/python3"
|
|
find "$INSTALL_DIR/venv/bin" -type f -exec grep -l '#!/home/akiba' {} \; 2>/dev/null | while read f; do
|
|
sudo sed -i "s|#!/home/akiba/CA/backend/venv/bin/python3|#!$VENV_PYTHON|g" "$f"
|
|
done
|
|
|
|
# Fix permissions
|
|
sudo chown -R www-data:www-data $INSTALL_DIR
|
|
|
|
# Install systemd service
|
|
sudo cp cbpoa-backend.service /etc/systemd/system/
|
|
sudo systemctl daemon-reload
|
|
sudo systemctl enable cbpoa-backend
|
|
|
|
echo ""
|
|
echo "=== Done! Start with: ==="
|
|
echo " sudo systemctl start cbpoa-backend"
|
|
echo " curl http://localhost:8000/docs"
|