Switch default transport to WebSocket

- Dockerfile builds with --features websocket and sets VITE_TRANSPORT=websocket
- Server default feature changed from socketio to websocket
- Binary canvas transfer (1MB) instead of Socket.IO JSON (~3-4MB per connection)
- Significantly reduces memory pressure under concurrent connections
This commit is contained in:
2026-08-18 02:09:09 +02:00
parent f652785acb
commit 31f0fce7a9
2 changed files with 5 additions and 3 deletions

View File

@@ -3,6 +3,7 @@ WORKDIR /app/painter-js
COPY painter-js/package.json painter-js/bun.lock ./
RUN bun install --frozen-lockfile
COPY painter-js/ .
ENV VITE_TRANSPORT=websocket
RUN bun run build
FROM rust:1-alpine AS builder
@@ -13,10 +14,11 @@ COPY Cargo.toml Cargo.lock ./
COPY crates/ ./crates/
RUN mkdir -p painter-js/dist && echo '<html></html>' > painter-js/dist/index.html
RUN cargo build --release --bin server 2>&1 || true
RUN cargo build --release --bin server --no-default-features --features websocket 2>&1 || true
COPY --from=frontend /app/painter-js/dist ./painter-js/dist
RUN touch crates/adapters/http-axum/src/routes.rs && cargo build --release --bin server
RUN touch crates/adapters/http-axum/src/routes.rs && \
cargo build --release --bin server --no-default-features --features websocket
FROM scratch
COPY --from=builder /app/target/release/server /painter