From 275ace8356c9623723762084b60c0b7938cb550d Mon Sep 17 00:00:00 2001 From: Olgierd "Allgreed" Kasprowicz Date: Wed, 22 May 2019 21:01:41 +0200 Subject: [PATCH] Add Dockerfile --- .dockerignore | 1 + Dockerfile | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..eb5a316 100644 --- /dev/null +++ a/.dockerignore @@ -1,0 +1,1 @@ +target diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..16f6bd0 100644 --- /dev/null +++ a/Dockerfile @@ -1,0 +1,15 @@ +FROM rust:1.34.2-slim-stretch AS builder +RUN rustup install nightly-x86_64-unknown-linux-gnu + +COPY . /sources +WORKDIR /sources +RUN cargo +nightly build --release +RUN chown nobody:nogroup /sources/target/release/bin + + +FROM debian:stretch-slim +COPY --from=builder /sources/target/release/bin /pastebin + +USER nobody +EXPOSE 8000 +ENTRYPOINT ["/pastebin"] -- rgit 0.1.3