@@ -2,7 +2,7 @@ ARG PG_VERSION=15.2
2
2
ARG PG_MAJOR_VERSION=15
3
3
ARG VERSION=custom
4
4
5
- FROM golang:1.20 as flyutil
5
+ FROM golang:1.20
6
6
7
7
WORKDIR /go/src/github.com/fly-examples/fly-postgres
8
8
COPY . .
@@ -23,27 +23,40 @@ ENV PGDATA=/data/postgresql
23
23
ARG VERSION
24
24
ARG PG_MAJOR_VERSION
25
25
ARG POSTGIS_MAJOR=3
26
-
26
+ ARG HAPROXY_VERSION=2.7
27
27
28
28
LABEL fly.app_role=postgres_cluster
29
29
LABEL fly.version=${VERSION}
30
30
LABEL fly.pg-version=${PG_VERSION}
31
31
LABEL fly.pg-manager=repmgr
32
32
33
33
RUN apt-get update && apt-get install --no-install-recommends -y \
34
- ca-certificates iproute2 postgresql-$PG_MAJOR_VERSION-repmgr curl bash dnsutils vim haproxy socat procps ssh \
34
+ ca-certificates iproute2 postgresql-$PG_MAJOR_VERSION-repmgr curl bash dnsutils vim haproxy socat procps ssh gnupg \
35
35
&& apt autoremove -y
36
36
37
37
RUN echo "deb https://packagecloud.io/timescale/timescaledb/debian/ $(cat /etc/os-release | grep VERSION_CODENAME | cut -d'=' -f2) main" > /etc/apt/sources.list.d/timescaledb.list \
38
38
&& curl -L https://packagecloud.io/timescale/timescaledb/gpgkey | apt-key add -
39
39
40
+ # TimescaleDB and PostGIS
40
41
RUN apt-get update && apt-get install --no-install-recommends -y \
41
42
postgresql-$PG_MAJOR_VERSION-postgis-$POSTGIS_MAJOR \
42
43
postgresql-$PG_MAJOR_VERSION-postgis-$POSTGIS_MAJOR-scripts \
43
44
timescaledb-2-postgresql-$PG_MAJOR_VERSION \
44
45
timescaledb-toolkit-postgresql-$PG_MAJOR_VERSION \
45
46
&& apt autoremove -y
46
47
48
+ # Haproxy
49
+ RUN curl https://haproxy.debian.net/bernat.debian.org.gpg \
50
+ | gpg --dearmor > /usr/share/keyrings/haproxy.debian.net.gpg
51
+
52
+ RUN echo deb "[signed-by=/usr/share/keyrings/haproxy.debian.net.gpg]" \
53
+ http://haproxy.debian.net bullseye-backports-${HAPROXY_VERSION} main \
54
+ > /etc/apt/sources.list.d/haproxy.list
55
+
56
+ RUN apt-get update && apt-get install --no-install-recommends -y \
57
+ haproxy=$HAPROXY_VERSION.\* \
58
+ && apt autoremove -y
59
+
47
60
COPY --from=0 /fly/bin/* /usr/local/bin
48
61
COPY --from=postgres_exporter /postgres_exporter /usr/local/bin/
49
62
0 commit comments