File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,12 @@ COPY --from=build-env /usr/local/bin/wal-g /usr/local/bin/wal-g
41
41
ARG PG_SERVER_VERSION
42
42
ENV PG_SERVER_VERSION=${PG_SERVER_VERSION:-15}
43
43
44
+ ARG PG_UNIX_SOCKET_DIR
45
+ ENV PG_UNIX_SOCKET_DIR=${PG_UNIX_SOCKET_DIR:-"/var/run/postgresql" }
46
+
47
+ ARG PG_SERVER_PORT
48
+ ENV PG_SERVER_PORT=${PG_SERVER_PORT:-5432}
49
+
44
50
ARG PG_TIMETABLE_VERSION
45
51
ENV PG_TIMETABLE_VERSION=${PG_TIMETABLE_VERSION:-5.3.0}
46
52
ARG SET_USER_VERSION
@@ -184,15 +190,15 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \
184
190
&& apt-get clean -y autoclean \
185
191
&& rm -rf /var/lib/apt/lists/* \
186
192
# remove standard pgdata
187
- && rm -rf /var/lib/postgresql/${PG_SERVER_VERSION}/
193
+ && rm -rf /var/lib/postgresql/${PG_SERVER_VERSION}/
188
194
189
- EXPOSE 5432
195
+ EXPOSE ${PG_SERVER_PORT}
190
196
191
197
# Prepare Postgres start script
192
198
RUN echo "#!/bin/bash" > /pg_start.sh && chmod a+x /pg_start.sh \
193
- && echo "chown -R postgres:postgres \$ {PGDATA} /var/run/postgresql " \
199
+ && echo "chown -R postgres:postgres \$ {PGDATA} \$ {PG_UNIX_SOCKET_DIR} " \
194
200
>> /pg_start.sh \
195
- && printf "sudo -Eu postgres /usr/lib/postgresql/$(echo ${PG_SERVER_VERSION} | sed 's/beta.*//' | sed 's/rc.*//')/bin/postgres -D \$ {PGDATA} >& /proc/1/fd/1 \n " \
201
+ && printf "sudo -Eu postgres /usr/lib/postgresql/$(echo ${PG_SERVER_VERSION} | sed 's/beta.*//' | sed 's/rc.*//')/bin/postgres -D \$ {PGDATA} -k \$ {PG_UNIX_SOCKET_DIR} -p \$ {PG_SERVER_PORT} >& /proc/1/fd/1 \n " \
196
202
>> /pg_start.sh \
197
203
# Infinite sleep to allow restarting Postgres
198
204
&& echo "/bin/bash -c \" trap : TERM INT; sleep infinity & wait\" " \
You can’t perform that action at this time.
0 commit comments