Skip to content

Commit 74cd43d

Browse files
committed
Set PGDATA back to old alpine image path
1 parent c220059 commit 74cd43d

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

Dockerfile

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ RUN usermod -u 70 postgres \
2626
&& (find / -user 1000 -exec chown -h postgres {} \; || true)
2727

2828

29+
# Set PGDATA to the same location as our old alpine image
30+
RUN mkdir -p /var/lib/postgresql && mv /home/postgres/pgdata/* /var/lib/postgresql/ && chown -R postgres:postgres /var/lib/postgresql
31+
2932
# Below is copied from https://github.com/timescale/timescaledb-docker-ha/blob/master/Dockerfile
3033
# to minimise the size of this image
3134
## Create a smaller Docker image from the builder image
@@ -36,20 +39,20 @@ ARG PG_MAJOR=14
3639
ENTRYPOINT ["/docker-entrypoint.sh"]
3740
CMD ["postgres"]
3841

39-
ENV PGROOT=/home/postgres \
40-
PGDATA=/home/postgres/pgdata/data \
41-
PGLOG=/home/postgres/pg_log \
42-
PGSOCKET=/home/postgres/pgdata \
43-
BACKUPROOT=/home/postgres/pgdata/backup \
44-
PGBACKREST_CONFIG=/home/postgres/pgdata/backup/pgbackrest.conf \
42+
ENV PGROOT=/var/lib/postgresql \
43+
PGDATA=/var/lib/postgresql/data \
44+
PGLOG=/var/lib/postgresql/pg_log \
45+
PGSOCKET=/var/lib/postgresql \
46+
BACKUPROOT=/var/lib/postgresql/backup \
47+
PGBACKREST_CONFIG=/var/lib/postgresql/backup/pgbackrest.conf \
4548
PGBACKREST_STANZA=poddb \
4649
PATH=/usr/lib/postgresql/${PG_MAJOR}/bin:${PATH} \
4750
LC_ALL=C.UTF-8 \
4851
LANG=C.UTF-8 \
4952
# When having an interactive psql session, it is useful if the PAGER is disable
5053
PAGER=""
5154

52-
WORKDIR /home/postgres
55+
WORKDIR /var/lib/postgresql
5356
EXPOSE 5432 8008 8081
5457
USER postgres
5558

0 commit comments

Comments
 (0)