diff --git a/Dockerfile b/Dockerfile index 0a6c07e..06dbb79 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,29 +1,19 @@ -FROM rust:slim as BUILD +FROM rust:alpine as BUILD -WORKDIR /app/ +RUN apk add --no-cache nasm git g++ -COPY . . +RUN git clone https://github.com/TeamPiped/piped-proxy.git /app -RUN --mount=type=cache,target=/var/cache/apt \ - apt-get update && \ - apt-get install -y --no-install-recommends \ - nasm && \ - rm -rf /var/lib/apt/lists/* +WORKDIR /app 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 +FROM scratch -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/ +WORKDIR /app COPY --from=BUILD /app/piped-proxy .