rust-nex/Dockerfile

19 lines
525 B
Text
Raw Normal View History

FROM rust:alpine AS builder
2025-03-06 09:50:48 +01:00
WORKDIR /app
COPY . .
RUN apk add --no-cache protobuf-dev git musl-dev lld
2025-03-06 09:58:22 +01:00
2025-03-06 10:20:19 +01:00
RUN git submodule update --init --recursive
2025-03-06 10:12:55 +01:00
RUN RUSTFLAGS="-C relocation-model=static -C linker=ld.lld" cargo build --profile prod --target x86_64-unknown-linux-musl
2025-03-06 09:50:48 +01:00
FROM scratch AS final
2025-03-06 09:50:48 +01:00
# Copy the compiled binary from the builder stage
COPY --from=builder /app/target/x86_64-unknown-linux-musl/prod/splatoon-server-rust /splatoon-server-rust
2025-03-06 09:50:48 +01:00
# Command to run the application
ENTRYPOINT ["/splatoon-server-rust"]