2025-03-08 01:14:15 +01:00
|
|
|
FROM rust:alpine AS builder
|
2025-03-06 09:50:48 +01:00
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
|
|
COPY . .
|
|
|
|
|
|
2025-03-08 01:14:15 +01:00
|
|
|
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
|
|
|
|
2025-03-08 01:14:15 +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
|
|
|
|
2025-03-08 01:14:15 +01:00
|
|
|
FROM scratch AS final
|
2025-03-06 09:50:48 +01:00
|
|
|
|
|
|
|
|
# Copy the compiled binary from the builder stage
|
2025-03-08 01:14:15 +01:00
|
|
|
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
|
2025-03-08 01:14:15 +01:00
|
|
|
ENTRYPOINT ["/splatoon-server-rust"]
|