doctor-restart/Dockerfile

20 lines
567 B
Docker
Raw Permalink Normal View History

2024-09-12 13:35:01 +03:00
FROM lukemathwalker/cargo-chef:latest-rust-1 AS chef
WORKDIR /app
FROM chef AS planner
COPY . .
RUN cargo chef prepare --recipe-path recipe.json
2024-09-12 20:08:53 +03:00
FROM chef AS builder
2024-09-12 13:35:01 +03:00
COPY --from=planner /app/recipe.json recipe.json
2024-09-12 20:08:53 +03:00
RUN cargo chef cook --release --recipe-path recipe.json
2024-09-12 13:35:01 +03:00
COPY . .
2024-09-12 20:08:53 +03:00
RUN cargo build --release
2024-09-12 13:35:01 +03:00
FROM debian:12-slim AS runtime
WORKDIR /app
2024-09-12 20:08:53 +03:00
COPY --from=builder /app/target/release/doctor-restart /usr/local/bin
2024-09-12 20:43:58 +03:00
STOPSIGNAL SIGINT
ENTRYPOINT ["/usr/local/bin/doctor-restart"]
CMD ["-l", "auto-restart.unhealthy", "-i", "10s", "-u", "35s"]