Distribute GNU Health demo database along with image

This commit is contained in:
Disassembler 2018-11-07 10:10:07 +01:00
parent 49dffce0d0
commit 43922d8192
Signed by: Disassembler
GPG Key ID: 524BD33A0EE29499
2 changed files with 4 additions and 3 deletions

View File

@ -22,9 +22,7 @@ lxc-execute gnuhealth -- sh -c 'TRYTONPASSFILE=/tmp/.adminpwd trytond-admin -d g
rm -f /var/lib/lxc/gnuhealth/gnuhealth/tmp/.adminpwd rm -f /var/lib/lxc/gnuhealth/gnuhealth/tmp/.adminpwd
# Populate demo database # Populate demo database
wget http://health.gnu.org/downloads/postgres_dumps/gnuhealth-32-demo.sql.gz -O /tmp/gnuhealth_demo.sql.gz zcat /var/lib/lxc/gnuhealth/gnuhealth/srv/gnuhealth/gnuhealth_demo.sql.gz | lxc-attach -u 5432 -g 5432 postgres -- sh -c "PGPASSWORD=${GNUHEALTH_PWD} psql gnuhealth_demo gnuhealth"
zcat /tmp/gnuhealth_demo.sql.gz | lxc-attach -u 5432 -g 5432 postgres -- sh -c "PGPASSWORD=${GNUHEALTH_PWD} psql gnuhealth_demo gnuhealth"
rm -f /tmp/gnuhealth_demo.sql.gz
# Install service # Install service
cp etc/init.d/gnuhealth /etc/init.d/gnuhealth cp etc/init.d/gnuhealth /etc/init.d/gnuhealth

View File

@ -41,6 +41,9 @@ RUN EOF
sudo -u gnuhealth npm install --production sudo -u gnuhealth npm install --production
sudo -u gnuhealth ./node_modules/.bin/grunt sudo -u gnuhealth ./node_modules/.bin/grunt
# Download Demo database
wget http://health.gnu.org/downloads/postgres_dumps/gnuhealth-32-demo.sql.gz -O /srv/gnuhealth/gnuhealth_demo.sql.gz
# Cleanup # Cleanup
apk --no-cache del .deps apk --no-cache del .deps
find /srv/gnuhealth -name '.git*' -exec rm -rf {} + find /srv/gnuhealth -name '.git*' -exec rm -rf {} +