From 2a90927760c458f4f427dea623327e5fe2da9c3e Mon Sep 17 00:00:00 2001 From: jeff Date: Sun, 23 Aug 2020 20:59:09 +0000 Subject: [PATCH] Add Dockerfile for self-contained deployment. --- .dockerignore | 1 + Dockerfile | 12 ++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..9f97022 --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +target/ \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..4e889b6 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +# Yoinked from: +# https://github.com/emk/rust-musl-builder/blob/master/examples/using-diesel/Dockerfile +FROM ekidd/rust-musl-builder:stable AS builder +ADD --chown=rust:rust . ./ +RUN cargo build --release + +FROM alpine:latest +RUN apk --no-cache add ca-certificates +COPY --from=builder \ + /home/rust/src/target/x86_64-unknown-linux-musl/release/dicebot \ + /usr/local/bin/ +CMD /usr/local/bin/dicebot /config/dicebot-config.toml