Spotter-VM/lxc-apps/gnuhealth/image

52 lines
2.1 KiB
Plaintext
Raw Normal View History

2020-04-04 00:17:24 +02:00
IMAGE gnuhealth_3.6.3-200403
FROM alpine3.11-python3.8_3.8.2-200403
2018-09-13 13:12:46 +02:00
RUN EOF
# Install runtime dependencies
2019-11-30 09:59:32 +01:00
apk --no-cache add bash coreutils libffi libjpeg-turbo libpq nodejs
2018-09-13 13:12:46 +02:00
# 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
2020-03-17 13:39:43 +01:00
wget http://ftp.gnu.org/gnu/health/gnuhealth-3.6.3.tar.gz -O - | tar xzf - -C /srv
mv /srv/gnuhealth-* /srv/install
2018-09-13 13:12:46 +02:00
# Create OS user
addgroup -S -g 8080 gnuhealth
adduser -S -u 8080 -h /srv/gnuhealth -s /bin/bash -g gnuhealth -G gnuhealth gnuhealth
2018-09-13 13:12:46 +02:00
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
# Create symlink for the current version of trytond
ln -s /srv/gnuhealth/gnuhealth/tryton/server/trytond-* /srv/gnuhealth/gnuhealth/tryton/server/trytond-current
2020-03-17 13:39:43 +01:00
# Clone Sao (Tryton web client) repository
# Note: Sao version needs to be the same as Tryton version installed by GNU Health
git clone -b 5.0 --single-branch --depth 1 https://github.com/tryton/sao /srv/gnuhealth/sao
chown -R gnuhealth:gnuhealth /srv/gnuhealth/sao
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
# Download Demo database
2020-03-17 13:39:43 +01:00
wget http://health.gnu.org/downloads/postgres_dumps/gnuhealth-36-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 {} +
2019-03-01 14:30:32 +01:00
rm -rf /srv/install
2018-09-13 13:12:46 +02:00
EOF
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
ENV PYTHONPATH /srv/gnuhealth/gnuhealth/tryton/server/trytond-current:/srv/gnuhealth/gnuhealth/tryton/server/config
2019-10-03 20:36:14 +02:00
2020-03-17 13:39:43 +01:00
USER gnuhealth
CMD /srv/gnuhealth/gnuhealth/tryton/server/trytond-current/bin/trytond --verbose