You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
695 B
24 lines
695 B
FROM rust:1.68.0-slim as builder
|
|
|
|
ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
|
|
WORKDIR /usr/src/board
|
|
|
|
COPY Cargo.toml /usr/src/board/Cargo.toml
|
|
COPY board-frontend /usr/src/board/board-frontend
|
|
COPY board-network /usr/src/board/board-network
|
|
COPY board-server /usr/src/board/board-server
|
|
COPY board-shared /usr/src/board/board-shared
|
|
|
|
# Build with musl to run on Alpine
|
|
RUN rustup target add x86_64-unknown-linux-musl
|
|
RUN cargo build --target x86_64-unknown-linux-musl --release --bin board-server
|
|
|
|
|
|
FROM alpine:3.17.2 AS runtime
|
|
|
|
COPY --from=builder /usr/src/board/target/x86_64-unknown-linux-musl/release/board-server /usr/local/bin
|
|
|
|
EXPOSE 8080
|
|
|
|
ENTRYPOINT ["/usr/local/bin/board-server"]
|