pgweb/Dockerfile
Dan Sosedoff bbe9a97d05
Switch go build target to 1.19 (#603)
* Switch go build target to 1.19

* Add make docker-run target for testing new images

* Bump appveyor go version

* Fix appveyor paths
2022-12-06 18:34:08 -06:00

37 lines
1.1 KiB
Docker

# ------------------------------------------------------------------------------
# Builder Stage
# ------------------------------------------------------------------------------
FROM golang:1.19-bullseye AS build
WORKDIR /build
ADD . /build
RUN go mod download
RUN make build
# ------------------------------------------------------------------------------
# Release Stage
# ------------------------------------------------------------------------------
FROM debian:bullseye-slim
RUN \
apt-get update && \
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 \
apt-get clean autoclean && \
apt-get autoremove --yes && \
rm -rf /var/lib/{apt,dpkg,cache,log}/
COPY --from=build /build/pgweb /usr/bin/pgweb
EXPOSE 8081
CMD ["/usr/bin/pgweb", "--bind=0.0.0.0", "--listen=8081"]