deploy stuff

Orual 058d1a2c b683ddc3

+123 -51
+11
.env.example
··· 1 + # Docker Compose runtime environment 2 + # Copy to .env.prod and fill in values for production deployment 3 + 4 + # Registry hostname (used to pull images) 5 + REGISTRY_HOST=booskie-box.coin-aldebaran.ts.net 6 + 7 + # ClickHouse connection (indexer) 8 + CLICKHOUSE_URL=https://your-clickhouse-host:8443 9 + CLICKHOUSE_DATABASE=weaver 10 + CLICKHOUSE_USER=default 11 + CLICKHOUSE_PASSWORD=your-password-here
+1
.gitignore
··· 7 7 /alloy 8 8 .direnv 9 9 .env 10 + .env.prod 10 11 .devenv 11 12 CLAUDE.md 12 13 AGENTS.md
-36
Dockerfile
··· 1 - FROM rust:1 AS chef 2 - RUN cargo install cargo-chef 3 - WORKDIR /app 4 - 5 - FROM chef AS planner 6 - COPY . . 7 - RUN cargo chef prepare --recipe-path recipe.json 8 - 9 - 10 - FROM chef AS builder 11 - COPY --from=planner /app/recipe.json recipe.json 12 - RUN cargo chef cook --release --recipe-path recipe.json 13 - COPY . . 14 - 15 - # Install `dx` 16 - RUN curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash 17 - RUN cargo binstall dioxus-cli --root /.cargo -y --force 18 - ENV PATH="/.cargo/bin:$PATH" 19 - 20 - # Create the final bundle folder. Bundle always executes in release mode with optimizations enabled 21 - RUN cd crates/weaver-server && dx bundle --release 22 - 23 - FROM chef AS runtime 24 - 25 - 26 - COPY --from=builder /app/target/dx/weaver-server/release/web/ /usr/local/app 27 - 28 - # set our port and make sure to listen for all connections 29 - ENV PORT=8080 30 - ENV IP=0.0.0.0 31 - 32 - # expose the port 8080 33 - EXPOSE 8080 34 - 35 - WORKDIR /usr/local/app 36 - ENTRYPOINT [ "/usr/local/app/weaver-server" ]
+74
crates/weaver-app/Dockerfile
··· 1 + # Build stage with cargo-chef for dependency caching 2 + FROM rust:1-trixie AS chef 3 + # Pin nightly version for reproducibility 4 + RUN rustup default nightly-2025-12-04 && rustup component add rust-src --toolchain nightly-2025-12-04 5 + RUN cargo install cargo-chef 6 + WORKDIR /app 7 + 8 + FROM chef AS planner 9 + COPY . . 10 + RUN cargo chef prepare --recipe-path recipe.json 11 + 12 + FROM chef AS builder 13 + 14 + # Install build dependencies 15 + RUN apt-get update && apt-get install -y \ 16 + pkg-config \ 17 + libssl-dev \ 18 + && rm -rf /var/lib/apt/lists/* 19 + 20 + # Install wasm target and tools 21 + RUN rustup target add wasm32-unknown-unknown 22 + RUN cargo install wasm-bindgen-cli 23 + 24 + # Install dioxus-cli 25 + RUN curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash 26 + RUN cargo binstall dioxus-cli --root /usr/local -y --force 27 + 28 + # Cook dependencies first (cached layer) 29 + COPY --from=planner /app/recipe.json recipe.json 30 + RUN cargo chef cook --release --recipe-path recipe.json 31 + 32 + # Copy source code 33 + COPY . . 34 + 35 + # Use production env for build-time constants 36 + RUN cp crates/weaver-app/.env-prod crates/weaver-app/.env 37 + 38 + # Build wasm workers 39 + RUN RUSTFLAGS='--cfg getrandom_backend="wasm_js"' cargo build -p weaver-app --bin editor_worker --bin embed_worker \ 40 + --target wasm32-unknown-unknown --release \ 41 + --no-default-features --features "web" 42 + 43 + # Run wasm-bindgen on workers 44 + RUN wasm-bindgen target/wasm32-unknown-unknown/release/editor_worker.wasm \ 45 + --out-dir crates/weaver-app/public \ 46 + --target no-modules \ 47 + --no-typescript 48 + RUN wasm-bindgen target/wasm32-unknown-unknown/release/embed_worker.wasm \ 49 + --out-dir crates/weaver-app/public \ 50 + --target no-modules \ 51 + --no-typescript 52 + 53 + # Bundle the app 54 + RUN dx bundle --release --debug-symbols false -p weaver-app 55 + 56 + # Runtime stage 57 + FROM debian:bookworm-slim 58 + 59 + RUN apt-get update && apt-get install -y \ 60 + ca-certificates \ 61 + libssl3 \ 62 + && rm -rf /var/lib/apt/lists/* 63 + 64 + WORKDIR /app 65 + 66 + # Copy the bundled app 67 + COPY --from=builder /app/target/dx/weaver-app/release/web/ /app/ 68 + 69 + ENV PORT=8080 70 + ENV IP=0.0.0.0 71 + 72 + EXPOSE 8080 73 + 74 + ENTRYPOINT ["/app/weaver-app"]
+37 -15
docker-compose.yml
··· 1 1 services: 2 + # Docker registry for local image hosting 3 + registry: 4 + image: registry:2 5 + container_name: weaver-registry 6 + ports: 7 + - "5000:5000" 8 + volumes: 9 + - registry_data:/var/lib/registry 10 + restart: unless-stopped 11 + 2 12 # Tap - AT Protocol sync utility 3 - # Build from local indigo checkout, or use pre-built image 4 13 tap: 5 14 container_name: weaver-tap 6 15 image: ghcr.io/bluesky-social/indigo/tap:latest ··· 13 22 TAP_BIND: ":2480" 14 23 TAP_DISABLE_ACKS: "false" 15 24 TAP_LOG_LEVEL: info 16 - # Filter to weaver collections only 17 - #TAP_SIGNAL_COLLECTION: sh.weaver.edit.root 18 25 TAP_SIGNAL_COLLECTION: sh.tangled.actor.profile 19 26 TAP_COLLECTION_FILTERS: "sh.weaver.*,app.bsky.actor.profile,sh.tangled.*,pub.leaflet.*" 20 27 healthcheck: ··· 22 29 interval: 20s 23 30 timeout: 5s 24 31 retries: 3 32 + restart: unless-stopped 25 33 26 - # Weaver indexer - consumes from tap or direct firehose 34 + # Weaver indexer - consumes from tap 27 35 indexer: 28 36 container_name: weaver-indexer 29 - build: 30 - context: . 31 - dockerfile: crates/weaver-index/Dockerfile 32 - command: ["run"] 37 + image: ${REGISTRY_HOST:-localhost}:5000/weaver-index:latest 33 38 ports: 34 39 - "3000:3000" 35 40 environment: 36 - RUST_LOG: debug,weaver_index=debug,hyper_util::client::legacy::pool=info 37 - # ClickHouse connection (set these for your cloud/homelab instance) 41 + RUST_LOG: info,weaver_index=debug,hyper_util::client::legacy::pool=info 38 42 CLICKHOUSE_URL: ${CLICKHOUSE_URL} 39 43 CLICKHOUSE_DATABASE: ${CLICKHOUSE_DATABASE:-weaver} 40 44 CLICKHOUSE_USER: ${CLICKHOUSE_USER} 41 45 CLICKHOUSE_PASSWORD: ${CLICKHOUSE_PASSWORD} 42 - # Source mode: "firehose" or "tap" 43 46 INDEXER_SOURCE: tap 44 - # Tap connection (when INDEXER_SOURCE=tap) 45 47 TAP_URL: ws://tap:2480/channel 46 48 TAP_SEND_ACKS: "true" 47 - # Firehose connection (when INDEXER_SOURCE=firehose) 48 49 FIREHOSE_RELAY_URL: wss://bsky.network 49 - # Collection filters 50 50 INDEXER_COLLECTIONS: "sh.weaver.*,app.bsky.actor.profile,sh.tangled.*,pub.leaflet.*" 51 51 depends_on: 52 52 tap: 53 53 condition: service_healthy 54 54 healthcheck: 55 - test: ["CMD", "wget", "-q", "--spider", "http://localhost:2480/xrpc/_health"] 55 + test: ["CMD", "wget", "-q", "--spider", "http://localhost:3000/xrpc/_health"] 56 56 interval: 20s 57 57 timeout: 5s 58 58 retries: 3 59 + restart: unless-stopped 60 + 61 + # Weaver app - web frontend 62 + weaver-app: 63 + container_name: weaver-app 64 + image: ${REGISTRY_HOST:-localhost}:5000/weaver-app:latest 65 + ports: 66 + - "8080:8080" 67 + environment: 68 + PORT: 8080 69 + IP: 0.0.0.0 70 + RUST_LOG: info 71 + depends_on: 72 + indexer: 73 + condition: service_healthy 74 + healthcheck: 75 + test: ["CMD", "wget", "-q", "--spider", "http://localhost:8080/"] 76 + interval: 20s 77 + timeout: 5s 78 + retries: 3 79 + restart: unless-stopped 59 80 60 81 volumes: 82 + registry_data: 61 83 tap_data: