From 070953f47749b6f7b6ce56e35cd23908ef5d5268 Mon Sep 17 00:00:00 2001 From: thek4n Date: Wed, 3 Jun 2026 14:17:12 +0300 Subject: [PATCH] ci(docker): add Dockerfile --- .dockerignore | 8 +++++ Dockerfile | 36 ++++++++++++++++++++++ index.html | 82 --------------------------------------------------- 3 files changed, 44 insertions(+), 82 deletions(-) create mode 100644 .dockerignore create mode 100644 Dockerfile delete mode 100644 index.html diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..a40b2cb --- /dev/null +++ b/.dockerignore @@ -0,0 +1,8 @@ +target/ +.git/ +.gitignore +Dockerfile +.dockerignore +README.md +.env +*.md diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..4204cc8 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,36 @@ +# Chef +FROM rust:1.94 AS chef + +RUN apt-get update && apt-get install -y --no-install-recommends musl-tools && rm -rf /var/lib/apt/lists/* +RUN rustup target add x86_64-unknown-linux-musl +RUN cargo install --locked cargo-chef +WORKDIR /app + +COPY Cargo.toml Cargo.lock . +RUN mkdir src && touch src/main.rs +# Если у вас workspace или несколько крейтов, скопируйте их манифесты тоже: +# COPY crates/*/Cargo.toml ./crates/*/ + +RUN cargo chef prepare --recipe-path /app/recipe.json + + +# Builder +FROM chef AS builder + +COPY --from=chef /app/recipe.json /app/recipe.json +RUN cargo chef cook --target x86_64-unknown-linux-musl --release --recipe-path /app/recipe.json + +## Если есть rust-toolchain.toml +# COPY rust-toolchain.toml rust-toolchain.toml +# RUN cargo fetch + +COPY . . +RUN cargo build --target x86_64-unknown-linux-musl --release + + +# Runtime +FROM scratch + +COPY --from=builder /app/target/x86_64-unknown-linux-musl/release/example /usr/local/bin/example + +CMD ["/usr/local/bin/example"] diff --git a/index.html b/index.html deleted file mode 100644 index 2292244..0000000 --- a/index.html +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - thek4n - - - - - -
-
-
- - English - -
-
- -
-

TheK4n

-

Developer

-
- -
-

Projects

- -

- project - : - thek4n/paste.thek4n.ru - (copy/paste service) -

- -
- -
-

About Me

-

About me text

-
- -
-

GPG

- -

- Available at - thek4n.ru/gpgkey.txt -

- -
- - ::marker - - Show key - Copy - - key.... - -
- -
- -
-

Contacts

- -

- Telegram - : - @thek4n -

- -
- -
-

© 2026 Vladislav Kan <thek4n@yandex.ru>

-
-
- - - -