From cb8e210acbbf8152dc81c0e33e9ac1274eebaa75 Mon Sep 17 00:00:00 2001 From: Gunwant Jain Date: Tue, 13 Jul 2021 04:28:48 +0530 Subject: [PATCH] dockerfile: shaving off old bits; use rust stable now Building multi-layered containers gave weird 500 errors. I think they were permission based but don't have the time to look into it. Signed-off-by: Gunwant Jain --- Dockerfile | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index 496b3e4..d78c3cb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,19 +1,16 @@ -FROM rustlang/rust:nightly-slim AS builder -WORKDIR app +FROM rust:1 as builder +WORKDIR /app COPY . . -RUN cargo build --release -FROM debian:buster-slim AS runtime -WORKDIR app -RUN apt-get update -y \ - && apt-get autoremove -y \ - && apt-get clean -y \ - && rm -rf /var/lib/apt/lists/* +RUN cargo install --path . +RUN cargo clean -COPY --from=builder /app/target/release/bin bin RUN mkdir -p upload COPY ./templates templates +COPY ./static static + ENV ROCKET_ADDRESS=0.0.0.0 ENV ROCKET_PORT=6162 -ENTRYPOINT ["./bin"] +EXPOSE 6162 +CMD ["bin"]