From fb9010131f04a5118e6161d98f1c67aa5a7323d9 Mon Sep 17 00:00:00 2001 From: Nilstrieb <48135649+Nilstrieb@users.noreply.github.com> Date: Tue, 28 Jun 2022 20:14:45 +0200 Subject: [PATCH] docker --- .dockerignore | 2 ++ Dockerfile | 25 +++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..796603f --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +target +.env \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..99c5365 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,25 @@ +FROM rust as build + +RUN rustup toolchain install nightly +RUN rustup default nightly + +WORKDIR /app +COPY Cargo.toml Cargo.lock ./ +RUN mkdir src +RUN echo "fn main() {}" > src/main.rs + +RUN cargo build --release -Zsparse-registry + +COPY src ./src + +# now rebuild with the proper main +RUN touch src/main.rs +RUN cargo build --release -Zsparse-registry + +FROM debian:11.3 + +WORKDIR /app + +COPY --from=build /app/target/release/court-bot court-bot + +CMD ["/app/court-bot"] \ No newline at end of file