diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..62aa066 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,15 @@ +# Ignore everything +* + +# Allow files and directories +!/.cargo/ +!/Cargo.toml +!/Cargo.lock +!/crates/new_media +!/recipie.json +# Ignore unnecessary files inside allowed directories +# This should go after the allowed directories +# **/*~ +# **/*.log +# **/.DS_Store +# **/Thumbs.db diff --git a/Cargo.toml b/Cargo.toml index 7c8c3f4..7bd7a91 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [workspace] resolver = "2" -members = ["crates/*", "examples/*"] +members = ["crates/*"] package.rust-version = "1.75.0" diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..91e0152 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,25 @@ +FROM rust as planner +WORKDIR /app +RUN cargo install cargo-chef +COPY . . +RUN cargo chef prepare --recipe-path recipe.json + +FROM rust as cacher +WORKDIR /app +RUN cargo install cargo-chef +COPY --from=planner /app/recipe.json recipe.json +RUN cargo chef cook --release --recipe-path=recipe.json + +FROM rust as builder +COPY . /app +WORKDIR /app +COPY --from=cacher /app/target target +COPY --from=cacher /usr/local/cargo /usr/local/cargo +RUN cargo build --release + +FROM bitnami/minideb:bookworm +COPY --from=builder /app/target/release/new_media /app/new_media +WORKDIR /app + +EXPOSE 8080 +CMD ["./new_media"] diff --git a/examples/minimal/Cargo.toml b/crates/minimal_example/Cargo.toml similarity index 100% rename from examples/minimal/Cargo.toml rename to crates/minimal_example/Cargo.toml diff --git a/examples/minimal/src/main.rs b/crates/minimal_example/src/main.rs similarity index 100% rename from examples/minimal/src/main.rs rename to crates/minimal_example/src/main.rs diff --git a/examples/new_media/Cargo.toml b/crates/new_media/Cargo.toml similarity index 100% rename from examples/new_media/Cargo.toml rename to crates/new_media/Cargo.toml diff --git a/examples/new_media/src/controls.rs b/crates/new_media/src/controls.rs similarity index 100% rename from examples/new_media/src/controls.rs rename to crates/new_media/src/controls.rs diff --git a/examples/new_media/src/main.rs b/crates/new_media/src/main.rs similarity index 97% rename from examples/new_media/src/main.rs rename to crates/new_media/src/main.rs index c66d73a..fd0189e 100644 --- a/examples/new_media/src/main.rs +++ b/crates/new_media/src/main.rs @@ -30,7 +30,7 @@ fn setup_gaussian_cloud( ) { // let remote_file = Some("https://huggingface.co/datasets/cs50victor/splats/resolve/main/train/point_cloud/iteration_7000/point_cloud.gcloud"); // TODO: figure out how to load remote files later - let splat_file = "splats/counter/point_cloud/iteration_7000/point_cloud.gcloud"; + let splat_file = "splats/playroom/point_cloud/iteration_7000/point_cloud.gcloud"; log::info!("loading {}", splat_file); let cloud = asset_server.load(splat_file.to_string()); diff --git a/examples/new_media/src/server.rs b/crates/new_media/src/server.rs similarity index 100% rename from examples/new_media/src/server.rs rename to crates/new_media/src/server.rs diff --git a/demo/app/page.tsx b/demo/app/page.tsx index 2edefbc..0a420a7 100644 --- a/demo/app/page.tsx +++ b/demo/app/page.tsx @@ -4,7 +4,7 @@ export default function Page() { return (