From 2062f0bb89d1f66e1399155978166a4cab124144 Mon Sep 17 00:00:00 2001 From: Aleksei Voronov Date: Thu, 5 Oct 2023 20:20:06 +0200 Subject: [PATCH] Add a nice optimized dockerfile for deployment --- Dockerfile | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..fd7d02d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +FROM rust:1.72 + +RUN USER=root cargo new --bin nederlandskie +WORKDIR /nederlandskie + +COPY ./Cargo.lock ./Cargo.lock +COPY ./Cargo.toml ./Cargo.toml + +RUN cargo build --release +RUN rm src/*.rs + +COPY ./src ./src + +RUN rm ./target/release/deps/nederlandskie* +RUN cargo build --release + +EXPOSE 3000 +CMD ["./target/release/nederlandskie"]