Dockerfile 649 B

123456789101112131415161718192021222324
  1. # Build
  2. FROM rust:1.74.0 AS builder
  3. WORKDIR /usr/src/
  4. RUN rustup target add x86_64-unknown-linux-gnu
  5. RUN apt update && apt install libssl-dev
  6. RUN USER=root cargo new receqif
  7. WORKDIR /usr/src/receqif
  8. COPY Cargo.toml Cargo.lock ./
  9. RUN cargo build --release --features "docker"
  10. COPY src ./src
  11. RUN cargo install --target x86_64-unknown-linux-gnu --features "docker" --path .
  12. # Bundle
  13. FROM gcr.io/distroless/cc-debian12
  14. COPY --from=builder /usr/local/cargo/bin/receqif /bin/receqif
  15. USER 1000
  16. ARG TELEGRAM_TOKEN
  17. ENV TELOXIDE_TOKEN=$TELEGRAM_TOKEN
  18. ARG LOG_LEVEL
  19. ENV LOG_LEVEL=$LOG_LEVEL
  20. VOLUME ["/etc/receqif"]
  21. ENTRYPOINT ["/bin/receqif", "--telegram"]