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
No known key found for this signature in database
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
# Populate demo database
wget http://health.gnu.org/downloads/postgres_dumps/gnuhealth-32-demo.sql.gz -O /tmp/gnuhealth_demo.sql.gz
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
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"
# Install service
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 ./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
apk --no-cache del .deps
find /srv/gnuhealth -name '.git*' -exec rm -rf {} +