Fix tb-postgres docker image. Update postgreSQL version to 11
This commit is contained in:
parent
57c2915e65
commit
771bd70a33
@ -17,7 +17,11 @@
|
||||
FROM thingsboard/openjdk8
|
||||
|
||||
RUN apt-get update
|
||||
RUN apt-get install -y postgresql postgresql-contrib
|
||||
RUN apt-get install -y curl
|
||||
RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main' | tee --append /etc/apt/sources.list.d/pgdg.list > /dev/null
|
||||
RUN curl -L https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
|
||||
RUN apt-get update
|
||||
RUN apt-get install -y postgresql-11
|
||||
RUN update-rc.d postgresql disable
|
||||
|
||||
RUN mkdir -p /var/log/postgres
|
||||
|
||||
@ -17,13 +17,15 @@
|
||||
|
||||
firstlaunch=${DATA_FOLDER}/.firstlaunch
|
||||
|
||||
export PG_CTL=$(find /usr/lib/postgresql/ -name pg_ctl)
|
||||
|
||||
if [ ! -d ${PGDATA} ]; then
|
||||
mkdir -p ${PGDATA}
|
||||
chown -R postgres:postgres ${PGDATA}
|
||||
su postgres -c '/usr/lib/postgresql/10/bin/pg_ctl initdb -U postgres'
|
||||
su postgres -c '${PG_CTL} initdb -U postgres'
|
||||
fi
|
||||
|
||||
su postgres -c '/usr/lib/postgresql/10/bin/pg_ctl -l /var/log/postgres/postgres.log -w start'
|
||||
su postgres -c '${PG_CTL} -l /var/log/postgres/postgres.log -w start'
|
||||
|
||||
if [ ! -f ${firstlaunch} ]; then
|
||||
su postgres -c 'psql -U postgres -d postgres -c "CREATE DATABASE thingsboard"'
|
||||
|
||||
@ -15,4 +15,6 @@
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
su postgres -c '/usr/lib/postgresql/10/bin/pg_ctl stop'
|
||||
export PG_CTL=$(find /usr/lib/postgresql/ -name pg_ctl)
|
||||
|
||||
su postgres -c '${PG_CTL} stop'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user