Add dockerfile.

This commit is contained in:
Kavin 2022-11-02 17:05:30 +00:00
parent a6b0fd996c
commit 5cf99dd1fb
No known key found for this signature in database
GPG Key ID: 49451E4482CC5BCD
2 changed files with 31 additions and 0 deletions

5
.dockerignore Normal file
View File

@ -0,0 +1,5 @@
.*
*.md
target/
LICENSE
*.json

26
Dockerfile Normal file
View File

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