diff options
| author | Fuwn <[email protected]> | 2026-02-14 21:53:11 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2026-02-14 21:53:24 -0800 |
| commit | d277dbfc6f2ca5363928ee9ad41e3460a834242f (patch) | |
| tree | d54b6611a25ea083a34b1bc2403b1fa70417b0c7 /Dockerfile | |
| parent | fix(blog): Remove extra whitespace on category pages without descriptions (diff) | |
| download | locus-d277dbfc6f2ca5363928ee9ad41e3460a834242f.tar.xz locus-d277dbfc6f2ca5363928ee9ad41e3460a834242f.zip | |
build(container): Add justfile recipe to build and push latest/date tags to GitHub and GitLab
Diffstat (limited to 'Dockerfile')
| -rw-r--r-- | Dockerfile | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..0d55f14 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,50 @@ +# syntax=docker/dockerfile:1.7 + +ARG RUSTC_VERSION=nightly-2025-01-21 + +FROM clux/muslrust:${RUSTC_VERSION} AS build + +RUN rustup component add rust-src + +WORKDIR /source + +RUN cargo new locus + +WORKDIR /source/locus + +COPY amenadiel/ ./amenadiel/ +COPY Cargo.toml Cargo.lock ./ + +RUN --mount=type=cache,target=/root/.cargo/registry \ + --mount=type=cache,target=/root/.cargo/git \ + cargo build --release -Zbuild-std + +COPY .git ./.git +COPY content ./content +COPY src ./src +COPY build.rs ./build.rs +COPY yarte.toml ./yarte.toml + +RUN find ./content -name "*.DS_Store" -delete +RUN --mount=type=cache,target=/root/.cargo/registry \ + --mount=type=cache,target=/root/.cargo/git \ + cargo build --release --bin locus +RUN set -eux; \ + bin_path="$(find /source/locus/target -type f -path '*/release/locus' | head -n 1)"; \ + test -n "${bin_path}"; \ + strip -s "${bin_path}"; \ + cp "${bin_path}" /source/locus/locus +RUN strip -s /source/locus/locus +RUN mkdir /new_tmp + +FROM scratch AS runtime + +WORKDIR /locus + +COPY --from=build /source/locus/locus ./locus +COPY --from=build /source/locus/content ./content +COPY --from=build /new_tmp /tmp + +EXPOSE 1965 + +ENTRYPOINT ["./locus"] |