# Release image: packages the static binary built by scripts/release.sh.
# No compiler runs here, so the image builds in seconds on any machine.
FROM gcr.io/distroless/static-debian12:nonroot
COPY target/x86_64-unknown-linux-musl/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
# matches the owner of the ansible-managed data directory
USER 1000:1000
EXPOSE 4100
ENTRYPOINT ["/usr/local/bin/cities-labeler"]
