mirror of
https://github.com/postgresml/pgcat.git
synced 2026-03-23 17:36:28 +00:00
It could be used to implement container health checks. Example: PGPASSWORD="<some-password>" psql -U pgcat -p 6432 -h 127.0.0.1 -tA -c "show version;" -d pgcat >/dev/null
22 lines
612 B
Docker
22 lines
612 B
Docker
FROM rust:1-slim-bookworm AS builder
|
|
|
|
RUN apt-get update && \
|
|
apt-get install -y build-essential
|
|
|
|
COPY . /app
|
|
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
|
|
ENV RUST_LOG=info
|
|
CMD ["pgcat"]
|