account/Dockerfile

26 lines
691 B
Text
Raw Normal View History

# syntax=docker/dockerfile:1
FROM rust:alpine as builder
RUN apk add --no-cache musl-dev openssl-dev openssl-libs-static protobuf-dev lld
2025-03-05 23:20:11 +01:00
WORKDIR /app
COPY . .
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 --profile prod --target x86_64-unknown-linux-musl
2025-03-05 23:20:11 +01:00
2025-03-06 11:36:21 +00:00
RUN rm .env
FROM scratch AS final
2025-03-05 23:20:11 +01:00
WORKDIR /app
# Copy the compiled binary from the builder stage
COPY --from=builder /app/target/x86_64-unknown-linux-musl/prod/account /account
2025-03-05 23:20:11 +01:00
# Set executable permissions
# RUN chmod +x /account
2025-03-05 23:20:11 +01:00
# Command to run the application
ENTRYPOINT ["/account"]