2022-06-28 06:31:57 +03:00
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
# Builder Stage
|
|
|
|
# ------------------------------------------------------------------------------
|
2022-12-07 03:34:08 +03:00
|
|
|
FROM golang:1.19-bullseye AS build
|
2022-06-28 06:31:57 +03:00
|
|
|
|
|
|
|
WORKDIR /build
|
|
|
|
ADD . /build
|
|
|
|
|
2023-02-16 01:59:39 +03:00
|
|
|
RUN git config --global --add safe.directory /build
|
2022-06-28 06:31:57 +03:00
|
|
|
RUN go mod download
|
|
|
|
RUN make build
|
|
|
|
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
# Release Stage
|
|
|
|
# ------------------------------------------------------------------------------
|
2022-10-25 14:55:28 +03:00
|
|
|
FROM debian:bullseye-slim
|
2014-10-28 11:02:27 +03:00
|
|
|
|
2016-06-28 04:48:36 +03:00
|
|
|
RUN \
|
2022-06-28 06:31:57 +03:00
|
|
|
apt-get update && \
|
2022-10-25 14:55:28 +03:00
|
|
|
apt-get install -y ca-certificates openssl netcat curl gnupg lsb-release && \
|
|
|
|
update-ca-certificates
|
|
|
|
|
|
|
|
RUN \
|
|
|
|
curl --silent https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add && \
|
|
|
|
echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list && \
|
|
|
|
apt-get update && apt-get install -y postgresql-client
|
|
|
|
|
|
|
|
RUN \
|
2022-06-28 06:31:57 +03:00
|
|
|
apt-get clean autoclean && \
|
|
|
|
apt-get autoremove --yes && \
|
|
|
|
rm -rf /var/lib/{apt,dpkg,cache,log}/
|
|
|
|
|
|
|
|
COPY --from=build /build/pgweb /usr/bin/pgweb
|
2014-10-28 11:02:27 +03:00
|
|
|
|
2015-07-15 06:26:32 +03:00
|
|
|
EXPOSE 8081
|
2022-06-28 06:31:57 +03:00
|
|
|
|
2018-04-26 01:00:05 +03:00
|
|
|
CMD ["/usr/bin/pgweb", "--bind=0.0.0.0", "--listen=8081"]
|