FROM rustlang/rust:nightly-slim as builder WORKDIR /app ADD src/ src/ COPY Cargo.toml . COPY Cargo.lock . RUN cargo build --release FROM debian:10-slim WORKDIR /app COPY --from=builder /app/target/* ./ RUN chmod a+x maga RUN chmod a+x maga-serve RUN printf "#!/bin/bash\n./\$@" >> docker-entrypoint.sh RUN chmod a+x docker-entrypoint.sh ENTRYPOINT [ "/app/docker-entrypoint.sh" ]