From 3c0d56cdafd283ed26e619ac8fd13f9ecce5f3c4 Mon Sep 17 00:00:00 2001 From: gov Date: Wed, 4 Nov 2026 16:58:55 -0500 Subject: [PATCH] chore: docker --- .dockerignore | 5 +++++ Dockerfile | 21 +++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..944919c --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +target +.git +.env +*.sqlite +*.sqlite-* diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..0537ed3 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,21 @@ +# Debian release pinned on both stages so the binary's glibc matches at runtime. +# The image tag pins the compiler, so rust-toolchain.toml (and its editor +# components) is intentionally not copied in. +FROM rust:1.91-slim-bookworm AS build +WORKDIR /src +COPY Cargo.toml Cargo.lock ./ +COPY src ./src +RUN cargo build --release --bin cities-labeler + +FROM debian:bookworm-slim +RUN apt-get update \ + && apt-get install -y --no-install-recommends ca-certificates \ + && rm -rf /var/lib/apt/lists/* +COPY --from=build /src/target/release/cities-labeler /usr/local/bin/cities-labeler +COPY data /app/data +ENV CITIES_PATH=/app/data/cities.json \ + DB_PATH=/data/labeler.sqlite \ + PORT=4100 +USER 1000:1000 +EXPOSE 4100 +CMD ["cities-labeler"]