2022-11-02 17:05:30 +00:00
|
|
|
FROM rust:slim as BUILD
|
|
|
|
|
|
|
|
WORKDIR /app/
|
|
|
|
|
|
|
|
COPY . .
|
|
|
|
|
2023-07-13 09:02:11 +00:00
|
|
|
RUN --mount=type=cache,target=/var/cache/apt \
|
2023-07-13 00:46:25 +00:00
|
|
|
apt-get update && \
|
|
|
|
apt-get install -y --no-install-recommends \
|
|
|
|
nasm && \
|
|
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
|
2022-11-02 17:05:30 +00:00
|
|
|
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"]
|