@@ -21,15 +21,19 @@ COPY ./bin/* /fly/bin/
2121
2222FROM ubuntu:24.04
2323
24- ENV PGDATA=/data/postgresql
25- ENV PGPASSFILE=/data/.pgpass
26- ENV AWS_SHARED_CREDENTIALS_FILE=/data/.aws/credentials
2724ARG VERSION
2825ARG PG_MAJOR_VERSION
2926ARG POSTGIS_MAJOR=3
3027ARG HAPROXY_VERSION=2.8
3128ARG REPMGR_VERSION=5.4.1-1build2
3229
30+ ENV PGDATA=/data/postgresql
31+ ENV PGPASSFILE=/data/.pgpass
32+ ENV AWS_SHARED_CREDENTIALS_FILE=/data/.aws/credentials
33+ ENV PG_MAJOR_VERSION=${PG_MAJOR_VERSION}
34+ ENV PATH="/usr/lib/postgresql/${PG_MAJOR_VERSION}/bin:$PATH"
35+
36+
3337LABEL fly.app_role=postgres_cluster
3438LABEL fly.version=${VERSION}
3539LABEL fly.pg-version=${PG_VERSION}
@@ -63,16 +67,15 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
6367 haproxy=$HAPROXY_VERSION.\* \
6468 && apt autoremove -y && apt clean
6569
66-
67- # Add PostgreSQL bin directory to PATH
68- ENV PATH="/usr/lib/postgresql/${PG_MAJOR_VERSION}/bin:$PATH"
69-
7070# Copy Go binaries from the builder stage
7171COPY --from=builder /fly/bin/* /usr/local/bin
7272
7373# Copy Postgres exporter
7474COPY --from=wrouesnel/postgres_exporter:latest /postgres_exporter /usr/local/bin/
7575
76+ # Move pg_rewind into path.
77+ RUN ln -s /usr/lib/postgresql/${PG_MAJOR_VERSION}/bin/pg_rewind /usr/bin/pg_rewind
78+
7679ADD /config/* /fly/
7780RUN mkdir -p /run/haproxy/
7881RUN usermod -d /data postgres
0 commit comments