Add dockerfile.
This commit is contained in:
parent
a6b0fd996c
commit
5cf99dd1fb
2 changed files with 31 additions and 0 deletions
5
.dockerignore
Normal file
5
.dockerignore
Normal file
|
@ -0,0 +1,5 @@
|
|||
.*
|
||||
*.md
|
||||
target/
|
||||
LICENSE
|
||||
*.json
|
26
Dockerfile
Normal file
26
Dockerfile
Normal 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"]
|
Loading…
Reference in a new issue