account/Dockerfile
Maple Nebel 8d6a90df79
All checks were successful
Build and Test / account (push) Successful in 8m0s
fix openssl
2026-05-02 13:42:03 +02:00

33 lines
1 KiB
Docker

# syntax=docker/dockerfile:1
FROM rust:alpine as builder
RUN apk add --no-cache musl-dev openssl-dev openssl-libs-static protobuf-dev lld perl make
WORKDIR /app
COPY Cargo.toml Cargo.lock ./
COPY mii ./mii
RUN mkdir src && echo "fn main() {println!(\"dummy\");}" > src/main.rs
RUN OPENSSL_LIB_DIR=/usr/lib OPENSSL_INCLUDE_DIR=/usr/include/openssl OPENSSL_STATIC=1 RUSTFLAGS="-C target-feature=+aes,+sse -C relocation-model=static -C linker=ld.lld" cargo build --target x86_64-unknown-linux-musl --profile prod
COPY . .
RUN touch src/main.rs
ENV SQLX_OFFLINE=true
RUN RUSTFLAGS="-C target-feature=+aes,+sse -C relocation-model=static -C linker=ld.lld" cargo build --profile prod --target x86_64-unknown-linux-musl
FROM scratch AS final
WORKDIR /
# Copy the compiled binary from the builder stage
COPY --from=builder /app/target/x86_64-unknown-linux-musl/prod/account /account
COPY --from=builder /app/res /res
# Set executable permissions
# RUN chmod +x /account
# Command to run the application
ENTRYPOINT ["/account"]