[MIRROR ONLY] A correct and efficient ATProto blob proxy for secure content delivery. codeberg.org/Blooym/porxie
36
fork

Configure Feed

Select the types of activity you want to include in your feed.

build: use different caching for rust in docker

Lyna b29a9d13 fcd36d69

+16 -24
+3
.dockerignore
··· 1 + target/ 2 + .direnv/ 3 + __pycache__/
+13 -24
Dockerfile
··· 1 - # ---------- 2 - # SETUP 3 - # ---------- 4 - FROM alpine:latest AS setup 5 - RUN adduser -S -s /bin/false -D porxie 6 - 7 - # ----------- 8 - # BUILD 9 - # ----------- 1 + # Build Porxie. 10 2 FROM rust:1-alpine AS build 11 3 WORKDIR /build 12 4 RUN apk add --no-cache --update build-base 13 5 14 - # Pre-cache dependencies 15 6 COPY Cargo.toml Cargo.lock ./ 16 - COPY crates/porxie/Cargo.toml crates/porxie/Cargo.toml 17 - COPY crates/lexgen/Cargo.toml crates/lexgen/Cargo.toml 18 - RUN mkdir -p crates/porxie/src crates/lexgen/src \ 19 - && echo "// Placeholder" > crates/porxie/src/lib.rs \ 20 - && echo "// Placeholder" > crates/lexgen/src/lib.rs \ 21 - && cargo build --release \ 22 - && rm crates/porxie/src/lib.rs crates/lexgen/src/lib.rs 7 + COPY crates ./crates 8 + RUN --mount=type=cache,target=/usr/local/cargo/registry \ 9 + --mount=type=cache,target=/build/target \ 10 + cargo build --release && \ 11 + cp target/release/porxie /build/porxie 12 + 13 + 14 + # Environment to steal some files from. 15 + FROM alpine:latest AS setup 16 + RUN adduser -S -s /bin/false -D porxie 23 17 24 - # Build 25 - COPY crates ./crates 26 - RUN cargo build --release 27 18 28 - # ----------- 29 - # RUNTIME 30 - # ----------- 19 + # Runtime 31 20 FROM scratch 32 21 WORKDIR /opt 33 22 34 - COPY --from=build /build/target/release/porxie /usr/bin/porxie 23 + COPY --from=build /build/porxie /usr/bin/porxie 35 24 COPY --from=setup /etc/passwd /etc/passwd 36 25 COPY --from=setup /bin/false /bin/false 37 26 USER porxie