From 6d6bf7371bfa322eae766152873c65066a4f36f0 Mon Sep 17 00:00:00 2001 From: Edward Shen Date: Sun, 18 Jul 2021 21:27:29 -0400 Subject: [PATCH] Add dockerfile --- .dockerignore | 10 ++++++++++ Dockerfile | 9 +++++++++ 2 files changed, 19 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..81768b8 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,10 @@ +# Ignore everything +* + +# Only include necessary paths (This should be synchronized with `Cargo.toml`) +!db_queries/ +!src/ +!settings.sample.yaml +!sqlx-data.json +!Cargo.toml +!Cargo.lock \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..3112a06 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM rust:alpine as builder +COPY . . +RUN apk add --no-cache file make musl-dev \ + && cargo install --path . \ + && strip /usr/local/cargo/bin/mangadex-home + +FROM alpine:latest +COPY --from=builder /usr/local/cargo/bin/mangadex-home /usr/local/bin/mangadex-home +CMD ["mangadex-home"] \ No newline at end of file