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 <mail@wantguns.dev>
This commit is contained in:
Gunwant Jain 2021-07-13 04:28:48 +05:30
parent 80c6809414
commit cb8e210acb

View File

@ -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"]