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