forked from sosedoff/pgweb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
36 lines (28 loc) · 1.15 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# ------------------------------------------------------------------------------
# Builder Stage
# ------------------------------------------------------------------------------
FROM golang:1.19-bullseye AS build
WORKDIR /build
ADD . /build
RUN git config --global --add safe.directory /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
ENTRYPOINT ["/usr/bin/pgweb", "--bind=0.0.0.0", "--listen=8081"]