31 lines
891 B
Docker
31 lines
891 B
Docker
# featherChat server — multi-stage build
|
|
# Build context: featherChat repo root (../../..)
|
|
FROM rust:latest AS builder
|
|
|
|
WORKDIR /build
|
|
|
|
# Copy warzone workspace
|
|
COPY warzone/Cargo.toml warzone/Cargo.lock ./warzone/
|
|
COPY warzone/crates ./warzone/crates
|
|
|
|
WORKDIR /build/warzone
|
|
|
|
# Build WASM first (server embeds it via include_str!/include_bytes!)
|
|
RUN cargo install wasm-pack && \
|
|
wasm-pack build crates/warzone-wasm --target web --out-dir /build/warzone/wasm-pkg 2>&1 || true
|
|
|
|
# Build server (now wasm-pkg exists at the expected relative path)
|
|
RUN cargo build --release --bin warzone-server
|
|
|
|
# Runtime
|
|
FROM debian:trixie-slim
|
|
RUN apt-get update && apt-get install -y ca-certificates && rm -rf /var/lib/apt/lists/*
|
|
|
|
COPY --from=builder /build/warzone/target/release/warzone-server /usr/local/bin/
|
|
|
|
WORKDIR /data
|
|
EXPOSE 7700
|
|
|
|
ENTRYPOINT ["warzone-server"]
|
|
CMD ["--bind", "0.0.0.0:7700"]
|