doctor-restart/Dockerfile

20 lines
567 B
Docker
Raw Permalink Normal View History

2024-09-12 10:35:01 +00: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 17:08:53 +00:00
FROM chef AS builder
2024-09-12 10:35:01 +00:00
COPY --from=planner /app/recipe.json recipe.json
2024-09-12 17:08:53 +00:00
RUN cargo chef cook --release --recipe-path recipe.json
2024-09-12 10:35:01 +00:00
COPY . .
2024-09-12 17:08:53 +00:00
RUN cargo build --release
2024-09-12 10:35:01 +00:00
FROM debian:12-slim AS runtime
WORKDIR /app
2024-09-12 17:08:53 +00:00
COPY --from=builder /app/target/release/doctor-restart /usr/local/bin
2024-09-12 17:43:58 +00:00
STOPSIGNAL SIGINT
ENTRYPOINT ["/usr/local/bin/doctor-restart"]
CMD ["-l", "auto-restart.unhealthy", "-i", "10s", "-u", "35s"]