2019-09-18 11:29:58 +02:00
|
|
|
IMAGE gnuhealth_3.4.1-190620
|
2019-06-25 15:56:35 +02:00
|
|
|
|
2019-09-18 11:29:58 +02:00
|
|
|
LAYER alpine3.9_3.9.4-190620
|
|
|
|
LAYER alpine3.9-python3.6_3.6.8-190620
|
|
|
|
LAYER alpine3.9-nodejs10_10.14.2-190620
|
2018-09-13 13:12:46 +02:00
|
|
|
|
|
|
|
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
|
2019-05-08 10:34:35 +02:00
|
|
|
wget http://ftp.gnu.org/gnu/health/gnuhealth-3.4.1.tar.gz -O /tmp/gnuhealth.tgz
|
2018-09-13 13:12:46 +02:00
|
|
|
tar xzf /tmp/gnuhealth.tgz -C /srv
|
2019-05-08 10:34:35 +02:00
|
|
|
mv /srv/gnuhealth-3.4.1 /srv/install
|
2018-09-13 13:12:46 +02:00
|
|
|
|
2019-05-08 10:34:35 +02:00
|
|
|
# Hackfix python-barcode support (will work in 3.4.2 - see http://hg.savannah.gnu.org/hgweb/health/rev/61b7bc7b1a78)
|
2019-03-19 18:21:10 +01:00
|
|
|
sed -i 's/pybarcode/python-barcode/' /srv/install/gnuhealth-setup
|
|
|
|
|
2018-09-13 13:12:46 +02:00
|
|
|
# Clone Sao (Tryton web client) repository
|
2019-03-01 14:30:32 +01:00
|
|
|
git clone -b 4.6 --single-branch --depth 1 https://github.com/tryton/sao /srv/gnuhealth/sao
|
2018-09-13 13:12:46 +02:00
|
|
|
|
|
|
|
# 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
|
2019-03-01 14:30:32 +01:00
|
|
|
cd /srv/install
|
2018-09-13 13:12:46 +02:00
|
|
|
sudo -u gnuhealth ./gnuhealth-setup install
|
|
|
|
|
2019-10-05 23:09:59 +02:00
|
|
|
# Create symlink for the current version of trytond
|
|
|
|
ln -s /srv/gnuhealth/gnuhealth/tryton/server/trytond-* /srv/gnuhealth/gnuhealth/tryton/server/trytond-current
|
|
|
|
|
2019-03-01 14:30:32 +01:00
|
|
|
# Hackfix extraneous pymongo requirement
|
|
|
|
sed -i '/pymongo/d' /srv/gnuhealth/gnuhealth/tryton/server/modules/health_federation/health_federation.py
|
|
|
|
|
2018-09-13 13:12:46 +02:00
|
|
|
# Hackfix template1 database lock
|
2019-10-05 23:09:59 +02:00
|
|
|
sed -i 's/template1/gnuhealth/g' /srv/gnuhealth/gnuhealth/tryton/server/trytond-current/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 --production
|
2019-03-01 14:30:32 +01:00
|
|
|
sudo -u gnuhealth ./node_modules/grunt-cli/bin/grunt
|
2018-09-13 13:12:46 +02:00
|
|
|
|
2018-11-07 10:10:07 +01:00
|
|
|
# Download Demo database
|
2019-03-01 14:30:32 +01:00
|
|
|
wget http://health.gnu.org/downloads/postgres_dumps/gnuhealth-34-demo.sql.gz -O /srv/gnuhealth/gnuhealth_demo.sql.gz
|
2018-11-07 10:10:07 +01:00
|
|
|
|
2018-09-13 13:12:46 +02:00
|
|
|
# Cleanup
|
|
|
|
apk --no-cache del .deps
|
|
|
|
find /srv/gnuhealth -name '.git*' -exec rm -rf {} +
|
2019-03-01 14:30:32 +01:00
|
|
|
rm -rf /srv/install
|
|
|
|
rm -f /tmp/gnuhealth.tgz
|
2018-09-13 13:12:46 +02:00
|
|
|
EOF
|
|
|
|
|
2019-10-05 23:09:59 +02:00
|
|
|
ENV PATH /srv/gnuhealth/gnuhealth/tryton/server/trytond-current/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
|
2019-10-05 23:09:59 +02:00
|
|
|
ENV PYTHONPATH /srv/gnuhealth/gnuhealth/tryton/server/trytond-current:/srv/gnuhealth/gnuhealth/tryton/server/config
|
2019-10-03 20:36:14 +02:00
|
|
|
|
|
|
|
USER 8008 8008
|
2018-09-13 13:12:46 +02:00
|
|
|
CMD trytond --verbose
|