From 9d42691ce0d6cea6ee63dbeb0607197c23ae8ce6 Mon Sep 17 00:00:00 2001 From: yuobrezkov Date: Tue, 18 Feb 2025 18:03:17 +0300 Subject: [PATCH] Added Dockerfile, changed Cargo.toml --- .dockerignore | 4 ++++ Cargo.toml | 1 + Dockerfile | 19 +++++++++++++++++++ 3 files changed, 24 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..42c9ff2 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,4 @@ +.idea/ +.vscode/ +.git/ +README.md diff --git a/Cargo.toml b/Cargo.toml index ef0dcae..ace7c74 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,3 +14,4 @@ anyhow = "1.0.95" env_logger = "0.11.6" log = "0.4.25" chrono = "0.4.39" +openssl = { version = "0.10", features = ["vendored"] } diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..1197e21 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +FROM rust:1.84 AS builder +WORKDIR /app + +RUN apt update && apt install -y musl-tools pkg-config libssl-dev + +RUN rustup target add x86_64-unknown-linux-musl + +COPY . . + +RUN cargo build --release --target=x86_64-unknown-linux-musl + +FROM alpine:3.21 +WORKDIR /app + +COPY --from=builder /app/target/x86_64-unknown-linux-musl/release/config-delivery /app/config-delivery +RUN apk add --no-cache ca-certificates +EXPOSE 9100 + +ENTRYPOINT ["/app/config-delivery"]