# --- build --- FROM rust:alpine as builder WORKDIR /opt/build COPY . . RUN apk add --no-cache musl-dev upx RUN cargo b -r RUN strip target/release/janitor && upx --best target/release/janitor # --- deploy --- FROM alpine:3.17 RUN mkdir /config WORKDIR /config COPY --from=builder /opt/build/target/release/janitor /bin/janitor CMD [ "/bin/janitor" ]