8000 fixes bug in docker · chazgorman/postgres-1@34cc677 · GitHub
[go: up one dir, main page]

Skip to content

Commit 34cc677

Browse files
committed
fixes bug in docker
- DB was not starting immediately
1 parent a0bf9ae commit 34cc677

File tree

3 files changed

+34
-11
lines changed

3 files changed

+34
-11
lines changed

ansible/files/docker_mnt/init.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
cat /etc/postgresql/postgresql.conf > $PGDATA/postgresql.conf
1+
cat /etc/postgresql/postgresql.conf > $PGDATA/postgresql.conf
2+
echo "host replication $POSTGRES_USER 0.0.0.0/0 trust" >> $PGDATA/pg_hba.conf
3+
echo "host all all 127.0.0.1/32 trust" >> $PGDATA/pg_hba.conf

ansible/playbook-docker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
hosts: localhost
4141
tasks:
4242
- name: Commit Docker image
43-
command: docker commit "supabase-postgres-build" "supabase/postgres"
43+
command: docker commit --change='CMD ["postgres"]' "supabase-postgres-build" "supabase/postgres"
4444

4545
- name: Clean Up Postgres Image
4646
hosts: localhost

ansible/tasks/docker/setup.yml

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,36 @@
3232
src: files/postgresql_config/postgresql.conf.j2
3333
dest: etc/postgresql/postgresql.conf
3434

35-
- name: Setup - import pg_hba.conf
36-
template:
37-
src: files/postgresql_config/pg_hba.conf.j2
38-
dest: etc/postgresql/pg_hba.conf
39-
40-
- name: Setup - import pg_ident.conf
41-
template:
42-
src: files/postgresql_config/pg_ident.conf.j2
43-
dest: etc/postgresql/pg_ident.conf
35+
- set_fact:
36+
regex_string: "#unix_socket_directories = '/tmp'"
37+
38+
- name: Setup - modify unix_socket_directories
39+
become: yes
40+
replace:
41+
path: /etc/postgresql/postgresql.conf
42+
regexp: '{{ regex_string }}'
43+
replace: unix_socket_directories = '/var/run/postgresql'
44+
45+
- name: Setup - modify unix_socket_directories
46+
become: yes
47+
replace:
48+
path: /etc/postgresql/postgresql.conf
49+
regexp: '{{ regex_string }}'
50+
replace: unix_socket_directories = '/var/run/postgresql'
51+
52+
- name: Setup - modify hba_file directory
53+
become: yes
54+
replace:
55+
path: /etc/postgresql/postgresql.conf
56+
regexp: hba_file = '/etc/postgresql/pg_hba.conf'
57+
replace: hba_file = '/var/lib/postgresql/data/pg_hba.conf'
58+
59+
- name: Setup - modify ident_file directory
60+
become: yes
61+
replace:
62+
path: /etc/postgresql/postgresql.conf
63+
regexp: ident_file = '/etc/postgresql/pg_ident.conf'
64+
replace: ident_file = '/var/lib/postgresql/data/pg_ident.conf'
4465

4566
- name: Setup - add init script to /docker-entrypoint-initdb.d
4667
synchronize:

0 commit comments

Comments
 (0)
0