Spaces:
Sleeping
Sleeping
Download Dockerfile from JustKozrhik/RustPrinter: direct link, hf CLI and curl.
- Browser
- Download file 660 Bytes
-
https://huggingface.co/spaces/JustKozrhik/RustPrinter/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/JustKozrhik/RustPrinter/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/JustKozrhik/RustPrinter/resolve/main/Dockerfile
660 Bytes
| # --- сборка --- | |
| FROM rust:1-bookworm AS build | |
| WORKDIR /app | |
| # кэш зависимостей | |
| COPY Cargo.toml Cargo.lock* ./ | |
| RUN mkdir src && echo "fn main() {}" > src/main.rs \ | |
| && cargo build --release \ | |
| && rm -rf src | |
| COPY src ./src | |
| RUN touch src/main.rs && cargo build --release | |
| # --- рантайм --- | |
| FROM debian:bookworm-slim | |
| RUN apt-get update \ | |
| && apt-get install -y --no-install-recommends ca-certificates \ | |
| && rm -rf /var/lib/apt/lists/* \ | |
| && useradd -m -u 1000 user | |
| COPY --from=build /app/target/release/litematic-host /usr/local/bin/litematic-host | |
| USER user | |
| ENV PORT=7860 RUST_LOG=info | |
| EXPOSE 7860 | |
| CMD ["litematic-host"] | |