Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 6 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Copy link
Member

@Bnyro Bnyro Aug 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's unnecessary, you should just leave that as it was before and copy the source code from the current directory instead of cloning it.


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 && \
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need ca-certificates in image, otherwise HTTPS won't work

rm -rf /var/lib/apt/lists/*

WORKDIR /app/
WORKDIR /app

COPY --from=BUILD /app/piped-proxy .

Expand Down