Adding usermod to entrypoint.

This commit is contained in:
Samuel Clay 2024-01-27 23:21:08 -05:00
parent 365492b043
commit f391c88da8
3 changed files with 14 additions and 2 deletions

View file

@ -4,3 +4,6 @@ RUN apt update && apt install -y openssh-client rsync
RUN usermod -u 1000 postgres
RUN groupmod -g 1001 postgres
COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]

View file

@ -0,0 +1,9 @@
#!/bin/bash
# entrypoint.sh
# Create a user with the specified UID/GID
usermod -u 1000 postgres
groupmod -g 1001 postgres
# Execute the original entrypoint of the image
exec docker-entrypoint.sh postgres

View file

@ -249,8 +249,8 @@ archive_command = 'test ! -f /var/lib/postgresql/archive/%f && cp -f %p /var/lib
# These are only used in recovery mode.
restore_command = 'rsync -a -e "ssh -i /var/lib/postgresql/.ssh/id_rsa" db-postgres.service.consul:/srv/newsblur/docker/volumes/postgres/archive/%f "%p"'
# restore_command = 'cp /var/lib/postgresql/archive/%f %p' # command to use to restore an archived logfile segment
# restore_command = 'rsync -a -e "ssh -i /var/lib/postgresql/.ssh/id_rsa" db-postgres.service.consul:/srv/newsblur/docker/volumes/postgres/archive/%f "%p"'
restore_command = 'cp /var/lib/postgresql/archive/%f %p' # command to use to restore an archived logfile segment
# placeholders: %p = path of file to restore
# %f = file name only
# e.g. 'cp /mnt/server/archivedir/%f %p'