Adding CMD to postgres dockerfile.

This commit is contained in:
Samuel Clay 2024-01-28 00:38:05 -05:00
parent 2a8d1096bc
commit 2690acdf63
3 changed files with 5 additions and 6 deletions

View file

@ -58,6 +58,7 @@
state: present
- name: Start postgres docker containers
become: yes
docker_container:
name: postgres
image: newsblur/postgres:13
@ -76,7 +77,6 @@
- postgres
ports:
- 5432:5432
user: "{{ ansible_effective_user_id|int }}:{{ ansible_effective_group_id|int }}"
volumes:
- /srv/newsblur/docker/volumes/postgres/data:/var/lib/postgresql/data
- /srv/newsblur/docker/volumes/postgres/archive:/var/lib/postgresql/archive

View file

@ -2,8 +2,7 @@ FROM postgres:13
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"]
CMD ["postgres", "-c", "config_file=/etc/postgresql/postgresql.conf"]

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" nb@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'