2025-03-25 07:30:10 +00:00
|
|
|
FROM rust:alpine AS builder
|
|
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
|
|
COPY . .
|
|
|
|
|
|
2025-05-29 15:22:53 +02:00
|
|
|
RUN apk add --no-cache protobuf-dev git musl-dev lld openssl-dev openssl-libs-static
|
2025-03-25 07:30:10 +00:00
|
|
|
|
|
|
|
|
RUN git submodule update --init --recursive
|
|
|
|
|
|
2025-06-06 14:51:41 +02:00
|
|
|
RUN OPENSSL_LIB_DIR=/usr/lib OPENSSL_INCLUDE_DIR=/usr/include/openssl OPENSSL_STATIC=1 RUSTFLAGS="-C relocation-model=static -C linker=ld.lld" cargo test --target x86_64-unknown-linux-musl
|
2025-05-29 15:22:53 +02:00
|
|
|
RUN OPENSSL_LIB_DIR=/usr/lib OPENSSL_INCLUDE_DIR=/usr/include/openssl OPENSSL_STATIC=1 RUSTFLAGS="-C relocation-model=static -C linker=ld.lld" cargo build --profile prod --target x86_64-unknown-linux-musl
|
2025-03-25 07:30:10 +00:00
|
|
|
|
|
|
|
|
FROM scratch AS final
|
|
|
|
|
|
|
|
|
|
# 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
|
|
|
|
|
|
|
|
|
|
# Command to run the application
|
|
|
|
|
ENTRYPOINT ["/splatoon-server-rust"]
|