2025-03-06 18:43:38 +01:00
|
|
|
FROM rust:alpine as builder
|
|
|
|
|
|
|
|
|
|
RUN apk add --no-cache musl-dev openssl-dev musl openssl libcrypto3
|
2025-03-05 23:20:11 +01:00
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
|
|
COPY . .
|
|
|
|
|
|
2025-03-07 11:48:39 +00:00
|
|
|
RUN cargo build --profile prod
|
2025-03-05 23:20:11 +01:00
|
|
|
|
2025-03-06 11:36:21 +00:00
|
|
|
RUN rm .env
|
|
|
|
|
|
2025-03-06 18:43:38 +01:00
|
|
|
FROM rust:alpine AS final
|
2025-03-05 23:20:11 +01:00
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
|
|
# Copy the compiled binary from the builder stage
|
2025-03-07 11:59:08 +00:00
|
|
|
COPY --from=builder /app/target/prod/account /app/account
|
2025-03-05 23:20:11 +01:00
|
|
|
|
|
|
|
|
# Set executable permissions
|
2025-03-06 11:41:04 +00:00
|
|
|
RUN chmod +x /app/account
|
2025-03-05 23:20:11 +01:00
|
|
|
|
|
|
|
|
# Command to run the application
|
|
|
|
|
CMD ["ls /app"]
|
|
|
|
|
CMD ["/app/account"]
|