Init
This commit is contained in:
commit
76b43a0386
38 changed files with 5003 additions and 0 deletions
29
Dockerfile
Normal file
29
Dockerfile
Normal file
|
@ -0,0 +1,29 @@
|
|||
ARG RUST_VERSION="1.82.0"
|
||||
FROM git.dergrimm.net/dergrimm/muslrust:${RUST_VERSION} AS chef
|
||||
|
||||
FROM chef AS planner
|
||||
WORKDIR /usr/src
|
||||
RUN mkdir -p kdash_client/src kdash_protocol/src kdash_server/src && touch kdash_client/src/main.rs kdash_protocol/src/lib.rs kdash_server/src/main.rs
|
||||
COPY Cargo.toml Cargo.lock ./
|
||||
COPY kdash_client/Cargo.toml kdash_client/Cargo.toml
|
||||
COPY kdash_protocol/Cargo.toml kdash_protocol/Cargo.toml
|
||||
COPY kdash_server/Cargo.toml kdash_server/Cargo.toml
|
||||
RUN cargo chef prepare --recipe-path recipe.json
|
||||
|
||||
FROM chef AS builder
|
||||
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||
WORKDIR /usr/src
|
||||
RUN mkdir bin/
|
||||
COPY .cargo .cargo
|
||||
COPY --from=planner /usr/src/recipe.json .
|
||||
RUN cargo chef cook --release --recipe-path recipe.json
|
||||
COPY kdash_client kdash_client
|
||||
COPY kdash_protocol kdash_protocol
|
||||
COPY kdash_server kdash_server
|
||||
RUN cargo build --package kdash_server --release && mv target/x86_64-unknown-linux-musl/release/kdash_server bin/kdash_server
|
||||
|
||||
FROM docker.io/alpine:3
|
||||
WORKDIR /usr/src
|
||||
COPY --from=builder /usr/src/bin/kdash_server .
|
||||
ENTRYPOINT [ "/usr/src/kdash_server" ]
|
||||
EXPOSE 8080
|
Loading…
Add table
Add a link
Reference in a new issue