diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..a099dca --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +target +Dockerfile diff --git a/.gitignore b/.gitignore index ea8c4bf..4fe9b98 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /target +docker-compose.yml diff --git a/Cargo.toml b/Cargo.toml index 69bfbdb..6a387aa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,3 +8,8 @@ hyper-util = { version = "0.1.10", features = ["tokio"] } hyper = { version = "1.6.0", features = ["full"] } tokio = { version = "1.43.0", features = ["full"] } http-body-util = "0.1.2" + +[profile.release] +strip = true +lto = true +opt-level = 3 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ed6cc05 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,14 @@ +FROM rust:alpine AS build + +RUN apk add musl-dev + +WORKDIR /build +COPY . . + +RUN cargo b -r + +FROM alpine:3.21 + +COPY --from=build /build/target/release/ipblekcodes /usr/bin/server + +ENTRYPOINT [ "/usr/bin/server" ] \ No newline at end of file