From 5cf99dd1fbadd7cad342914792f27a37da62e69e Mon Sep 17 00:00:00 2001 From: Kavin <20838718+FireMasterK@users.noreply.github.com> Date: Wed, 2 Nov 2022 17:05:30 +0000 Subject: [PATCH] Add dockerfile. --- .dockerignore | 5 +++++ Dockerfile | 26 ++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..a2341c9 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +.* +*.md +target/ +LICENSE +*.json diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..6e8d9a2 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,26 @@ +FROM rust:slim as BUILD + +WORKDIR /app/ + +COPY . . + +RUN --mount=type=cache,target=/usr/local/cargo/registry \ + --mount=type=cache,target=/app/target/ \ + cargo build --release && \ + mv target/release/piped-proxy . + +FROM debian:stable-slim + +RUN --mount=type=cache,target=/var/cache/apt \ + apt-get update && \ + apt-get install -y --no-install-recommends \ + ca-certificates && \ + rm -rf /var/lib/apt/lists/* + +WORKDIR /app/ + +COPY --from=BUILD /app/piped-proxy . + +EXPOSE 8080 + +CMD ["/app/piped-proxy"]