FROM rust:1-bookworm AS builder
WORKDIR /build
COPY Cargo.toml Cargo.lock ./
COPY crates/ crates/
COPY frontend/ frontend/
RUN cargo build --release -p itsgoin-cli

FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y ca-certificates && rm -rf /var/lib/apt/lists/*
COPY --from=builder /build/target/release/itsgoin /usr/local/bin/itsgoin
EXPOSE 4433/udp
VOLUME /data
ENTRYPOINT ["itsgoin", "/data", "--bind", "0.0.0.0:4433", "--daemon"]
