Spotter-VM/gnuhealth/lxcfile

59 lines
2.3 KiB
Plaintext
Raw Normal View History

2018-09-13 13:12:46 +02:00
IMAGE gnuhealth
LAYER shared/alpine3.9
LAYER shared/alpine3.9-python3.6
LAYER shared/alpine3.9-nodejs10
2018-09-13 13:12:46 +02:00
LAYER gnuhealth/gnuhealth
FIXLAYER /usr/bin/fix-apk
RUN EOF
# Install runtime dependencies
apk --no-cache add bash coreutils libffi libjpeg-turbo libpq
# Install build dependencies
apk --no-cache add --virtual .deps build-base git libffi-dev libjpeg-turbo-dev libxml2-dev libxslt-dev ncurses npm patch postgresql-dev python3-dev sudo
# Download GNU Health
wget http://ftp.gnu.org/gnu/health/gnuhealth-3.2.10.tar.gz -O /tmp/gnuhealth.tgz
tar xzf /tmp/gnuhealth.tgz -C /srv
mv /srv/gnuhealth-3.2.10 /srv/gnuhealth
rm -f /tmp/gnuhealth.tgz
# Clone Sao (Tryton web client) repository
git clone -b 4.2 --single-branch --depth 1 https://github.com/tryton/sao /srv/gnuhealth/sao
# Create OS user
addgroup -S -g 8008 gnuhealth
adduser -S -u 8008 -h /srv/gnuhealth -s /bin/bash -g gnuhealth -G gnuhealth gnuhealth
chown -R gnuhealth:gnuhealth /srv/gnuhealth
# Install GNU Health
cd /srv/gnuhealth
sudo -u gnuhealth ./gnuhealth-setup install
# Hackfix template1 database lock
sed -i 's/template1/gnuhealth/g' /srv/gnuhealth/gnuhealth/tryton/server/trytond-4.2.20/trytond/backend/postgresql/database.py
2018-09-13 13:12:46 +02:00
# Install Sao (Tryton web client) dependencies
cd /srv/gnuhealth/sao
sudo -u gnuhealth npm install grunt grunt-cli grunt-contrib-concat grunt-contrib-jshint grunt-contrib-uglify grunt-contrib-less grunt-po2json
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
2018-09-13 13:12:46 +02:00
# Cleanup
apk --no-cache del .deps
find /srv/gnuhealth -name '.git*' -exec rm -rf {} +
rm -rf /usr/local/share/.cache
EOF
2018-09-14 18:13:11 +02:00
MOUNT DIR /srv/gnuhealth/conf srv/gnuhealth/gnuhealth/tryton/server/config
2018-09-13 13:12:46 +02:00
USER 8008 8008
ENV PATH /srv/gnuhealth/gnuhealth/tryton/server/trytond-4.2.20/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
2018-09-13 13:12:46 +02:00
ENV TRYTOND_CONFIG /srv/gnuhealth/gnuhealth/tryton/server/config/trytond.conf
ENV PYTHONPATH /srv/gnuhealth/gnuhealth/tryton/server/trytond-4.2.20:/srv/gnuhealth/gnuhealth/tryton/server/config
2018-09-13 13:12:46 +02:00
CMD trytond --verbose