Skip to content

Commit

Permalink
chore(Dockerfile): mv pg run path to /postgresql
Browse files Browse the repository at this point in the history
  • Loading branch information
hyy0322 committed Dec 4, 2020
1 parent 5f52168 commit d5d3b53
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions make/photon/db/Dockerfile.base
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ RUN tdnf install -y shadow gzip postgresql >> /dev/null\
&& groupadd -r postgres --gid=999 \
&& useradd -m -r -g postgres --uid=999 postgres \
&& mkdir -p /docker-entrypoint-initdb.d \
&& mkdir -p /run/postgresql \
&& chown -R postgres:postgres /run/postgresql \
&& chmod 2777 /run/postgresql \
&& mkdir -p /postgresql \
&& chown -R postgres:postgres /postgresql \
&& chmod 2777 /postgresql \
&& mkdir -p "$PGDATA" && chown -R postgres:postgres "$PGDATA" && chmod 777 "$PGDATA" \
&& sed -i "s|#listen_addresses = 'localhost'.*|listen_addresses = '*'|g" /usr/share/postgresql/postgresql.conf.sample \
&& sed -i "s|#unix_socket_directories = '/tmp'.*|unix_socket_directories = '/run/postgresql'|g" /usr/share/postgresql/postgresql.conf.sample \
&& sed -i "s|#unix_socket_directories = '/tmp'.*|unix_socket_directories = '/postgresql'|g" /usr/share/postgresql/postgresql.conf.sample \
&& tdnf clean all

RUN tdnf erase -y toybox && tdnf install -y util-linux net-tools
2 changes: 1 addition & 1 deletion make/photon/db/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ EOF
file_env 'POSTGRES_USER' 'postgres'
file_env 'POSTGRES_DB' "$POSTGRES_USER"

psql=( psql -v ON_ERROR_STOP=1 )
psql=( psql -h /postgresql -v ON_ERROR_STOP=1 )

if [ "$POSTGRES_DB" != 'postgres' ]; then
"${psql[@]}" --username postgres <<-EOSQL
Expand Down

0 comments on commit d5d3b53

Please sign in to comment.