FROM rust:1.80-alpine3.20 as build

COPY battlesnake/ /usr/app
WORKDIR /usr/app

RUN apk add --no-cache musl-dev=1.2.5-r0
RUN cargo install --path .

FROM alpine:3.20
COPY --from=build /usr/local/cargo/bin/battlesnake /bin/battlesnake

CMD ["battlesnake"]
