From eb2500c1314c56c488743aae3905e61af7b18ad0 Mon Sep 17 00:00:00 2001 From: Nico Vanelslande Date: Wed, 27 Sep 2023 11:24:10 +0100 Subject: [PATCH] Add psql to the container image. It could be used to implement container health checks. Example: PGPASSWORD="" psql -U pgcat -p 6432 -h 127.0.0.1 -tA -c "show version;" -d pgcat >/dev/null --- Dockerfile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Dockerfile b/Dockerfile index f2d58062..be3df536 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,6 +8,12 @@ WORKDIR /app RUN cargo build --release FROM debian:bookworm-slim +RUN apt-get update && apt-get install -o Dpkg::Options::=--force-confdef -yq --no-install-recommends \ + postgresql-client \ + # Clean up layer + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \ + && truncate -s 0 /var/log/*log COPY --from=builder /app/target/release/pgcat /usr/bin/pgcat COPY --from=builder /app/pgcat.toml /etc/pgcat/pgcat.toml WORKDIR /etc/pgcat