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"
dependencies = [
"futures-core",
"futures-sink",
]
[[package]]
@@ -2074,6 +2075,7 @@ dependencies = [
"pile-flac",
"pile-io",
"regex",
"reqwest",
"serde",
"serde_json",
"smartstring",
@@ -2298,6 +2300,7 @@ dependencies = [
"base64",
"bytes",
"encoding_rs",
"futures-channel",
"futures-core",
"futures-util",
"h2",

View File

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

View File

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

View File

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

View File

@@ -69,11 +69,14 @@ fn main() {
eprintln!("cargo:warning=Downloading PDFium from {url}");
let status = std::process::Command::new("curl")
.args(["-L", "--fail", "-o", tgz_path.to_str().unwrap(), &url])
.status()
.expect("failed to run curl");
assert!(status.success(), "curl failed to download PDFium");
let response = reqwest::blocking::get(&url).expect("failed to download PDFium");
assert!(
response.status().is_success(),
"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")
.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"