Docker
All checks were successful
CI / Typos (push) Successful in 16s
CI / Build and test (push) Successful in 1m43s
CI / Clippy (push) Successful in 2m42s
Docker / build-and-push (push) Successful in 4m28s
CI / Build and test (all features) (push) Successful in 6m28s

This commit is contained in:
2026-03-26 19:49:36 -07:00
parent 47a0adbaff
commit fac300431a
6 changed files with 31 additions and 5 deletions

3
Cargo.lock generated
View File

@@ -894,6 +894,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "07bbe89c50d7a535e539b8c17bc0b49bdb77747034daa8087407d655f3f7cc1d" checksum = "07bbe89c50d7a535e539b8c17bc0b49bdb77747034daa8087407d655f3f7cc1d"
dependencies = [ dependencies = [
"futures-core", "futures-core",
"futures-sink",
] ]
[[package]] [[package]]
@@ -2074,6 +2075,7 @@ dependencies = [
"pile-flac", "pile-flac",
"pile-io", "pile-io",
"regex", "regex",
"reqwest",
"serde", "serde",
"serde_json", "serde_json",
"smartstring", "smartstring",
@@ -2298,6 +2300,7 @@ dependencies = [
"base64", "base64",
"bytes", "bytes",
"encoding_rs", "encoding_rs",
"futures-channel",
"futures-core", "futures-core",
"futures-util", "futures-util",
"h2", "h2",

View File

@@ -87,6 +87,8 @@ utoipa-swagger-ui = { version = "9.0.2", features = [
"debug-embed", "debug-embed",
"vendored", "vendored",
] } ] }
reqwest = { version = "0.12", features = ["blocking"] }
# Async & Parallelism # Async & Parallelism
tokio = { version = "1.49.0", features = ["full"] } tokio = { version = "1.49.0", features = ["full"] }

View File

@@ -29,6 +29,7 @@ RUN apt-get update && \
COPY --from=build \ COPY --from=build \
/app/rust/target/release/pile \ /app/rust/target/release/pile \
/app/rust/target/release/libpdfium.so \
/app/bin/ /app/bin/
ENV PATH="/app/bin:$PATH" ENV PATH="/app/bin:$PATH"

View File

@@ -34,6 +34,9 @@ mime_guess = { workspace = true }
serde = { workspace = true } serde = { workspace = true }
strum = { workspace = true } strum = { workspace = true }
[build-dependencies]
reqwest = { workspace = true }
[features] [features]
default = [] default = []
pdfium = ["dep:pdfium-render"] pdfium = ["dep:pdfium-render"]

View File

@@ -69,11 +69,14 @@ fn main() {
eprintln!("cargo:warning=Downloading PDFium from {url}"); eprintln!("cargo:warning=Downloading PDFium from {url}");
let status = std::process::Command::new("curl") let response = reqwest::blocking::get(&url).expect("failed to download PDFium");
.args(["-L", "--fail", "-o", tgz_path.to_str().unwrap(), &url]) assert!(
.status() response.status().is_success(),
.expect("failed to run curl"); "failed to download PDFium: {}",
assert!(status.success(), "curl failed to download PDFium"); response.status()
);
let bytes = response.bytes().expect("failed to read PDFium response");
std::fs::write(&tgz_path, &bytes).expect("failed to write pdfium.tgz");
let status = std::process::Command::new("tar") let status = std::process::Command::new("tar")
.args([ .args([

14
docker-compose.yml Normal file
View File

@@ -0,0 +1,14 @@
services:
pile:
#image: git.betalupi.com/mark/pile:latest
image: pile
container_name: pile
restart: unless-stopped
ports:
- 7100:7100
volumes:
- "./x.ignore/books:/data/books:ro"
- "./pile:/workdir"
command: "pile server -c /data/books/pile.toml --workdir /workdir 0.0.0.0:7100"