Add Dockerfile for self-contained deployment.

This commit is contained in:
jeff 2020-08-23 20:59:09 +00:00 committed by ProjectMoon
parent e4e2122d81
commit 2a90927760
2 changed files with 13 additions and 0 deletions

1
.dockerignore Normal file
View File

@ -0,0 +1 @@
target/

12
Dockerfile Normal file
View File

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