postCreate.sh 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #!/usr/bin/env bash
  2. set -uo pipefail
  3. echo "[devcontainer] Running postCreate tasks..."
  4. cd /workspaces/Pixelle-Video
  5. # ============================================================================
  6. # System Dependencies Installation
  7. # ============================================================================
  8. export DEBIAN_FRONTEND=noninteractive
  9. # Remove problematic Yarn repository if it exists
  10. echo "[devcontainer] Removing problematic repositories..."
  11. sudo rm -f /etc/apt/sources.list.d/yarn.sources 2>/dev/null || true
  12. sudo rm -f /etc/apt/sources.list.d/yarn.list 2>/dev/null || true
  13. # Update package lists
  14. echo "[devcontainer] Updating package lists..."
  15. sudo apt-get update -y || {
  16. echo "[devcontainer] Warning: apt-get update had issues, continuing anyway..."
  17. true
  18. }
  19. # Install system packages needed by the project
  20. echo "[devcontainer] Installing system packages..."
  21. sudo apt-get install -y --no-install-recommends \
  22. ffmpeg \
  23. fontconfig \
  24. fonts-liberation \
  25. fonts-noto-cjk \
  26. wget \
  27. xdg-utils \
  28. ca-certificates || true
  29. # Verify installation
  30. echo "[devcontainer] Verifying system packages..."
  31. echo "[devcontainer] Chinese fonts (sample):"
  32. fc-list :lang=zh | head -n 10 || true
  33. # ============================================================================
  34. # Python Dependencies Installation
  35. # ============================================================================
  36. # Install uv package manager
  37. echo "[devcontainer] Installing uv package manager..."
  38. pip install uv --quiet
  39. # Install Python dependencies with uv
  40. echo "[devcontainer] Installing Python dependencies with uv..."
  41. uv sync --frozen
  42. # Install Playwright browser (Chromium for HTML template rendering)
  43. echo "[devcontainer] Installing Playwright Chromium browser..."
  44. uv run playwright install --with-deps chromium || true
  45. echo "[devcontainer] postCreate complete. Streamlit will start automatically via postStart.sh"