Updates for 2.2.0
* Use timescaleDB CE intead of OSS * Have psql-app wait for psql to startup during init db * Add version file to postgres container
This commit is contained in:
parent
e19e5ac73a
commit
6e616efe10
@ -23,8 +23,8 @@
|
||||
# -----------------------------------------------
|
||||
# stage: Final container
|
||||
# -----------------------------------------------
|
||||
#FROM timescale/timescaledb-ha:pg14.3-ts2.7-latest
|
||||
FROM timescale/timescaledb-ha:pg14-ts2.7-oss-latest
|
||||
FROM timescale/timescaledb-ha:pg14-ts2.7-latest
|
||||
|
||||
ARG VERSION=0.0.0
|
||||
|
||||
ENV PGDATA=/var/lib/postgresql/data
|
||||
@ -42,8 +42,8 @@ USER root
|
||||
|
||||
RUN rm -rf /usr/lib/postgresql/12 /usr/lib/postgresql/13 \
|
||||
&& mkdir -p /var/lib/postgresql/data /var/lib/postgresql/ts/data \
|
||||
&& chown -R postgres /var/lib/postgresql/data /var/lib/postgresql/ts/data
|
||||
&& chown -R postgres /var/lib/postgresql/data /var/lib/postgresql/ts/data \
|
||||
&& mkdir -p /usr/local/openbmp \
|
||||
&& touch /usr/local/openbmp/version-${VERSION}
|
||||
|
||||
USER postgres
|
||||
|
||||
RUN touch /var/lib/postgresql/data/version-${VERSION}
|
||||
|
||||
@ -74,10 +74,22 @@ initdb_postgres() {
|
||||
if [[ ! -f /config/do_not_init_db ]]; then
|
||||
echo " ===> Initializing the DB"
|
||||
|
||||
echo "Waiting for postgres to start..."
|
||||
done=0
|
||||
while [ $done -eq 0 ]; do
|
||||
psql -c "select 1;" > /dev/null 2>&1
|
||||
if [[ $? -ne 0 ]]; then
|
||||
echo " postgres not running, sleeping for 20 seconds..."
|
||||
sleep 20
|
||||
else
|
||||
done=1
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
# Load the schema files
|
||||
echo " ===> Loading Schemas"
|
||||
|
||||
|
||||
echo "------" > /var/log/db_schema_load.log
|
||||
for file in $(ls -v /usr/local/openbmp/database/*.sql); do
|
||||
echo " ===[ $file ] ========================================" >> /var/log/db_schema_load.log
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user