2021-01-06 19:28:37 +01:00
|
|
|
IMAGE gnuhealth_3.6.5-210106
|
|
|
|
FROM alpine3.12-python3.8_3.8.5-210106
|
2018-09-13 13:12:46 +02:00
|
|
|
|
|
|
|
RUN EOF
|
|
|
|
# Install runtime dependencies
|
2020-06-21 13:10:24 +02:00
|
|
|
apk --no-cache add bash coreutils freetype libffi libjpeg-turbo libpq nodejs
|
2018-09-13 13:12:46 +02:00
|
|
|
|
|
|
|
# Install build dependencies
|
2020-06-21 13:10:24 +02:00
|
|
|
apk --no-cache add --virtual .deps build-base freetype-dev git libffi-dev libjpeg-turbo-dev libxml2-dev libxslt-dev ncurses npm patch postgresql-dev python3-dev sudo
|
2018-09-13 13:12:46 +02:00
|
|
|
|
|
|
|
# Download GNU Health
|
2020-10-22 21:03:16 +02:00
|
|
|
wget http://ftp.gnu.org/gnu/health/gnuhealth-3.6.5.tar.gz -O - | tar xzf - -C /srv
|
2020-03-17 13:39:43 +01:00
|
|
|
mv /srv/gnuhealth-* /srv/install
|
2018-09-13 13:12:46 +02:00
|
|
|
|
|
|
|
# Create OS user
|
2019-10-14 07:59:06 +02:00
|
|
|
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
|
|
|
|
|
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
|
|
|
|
|
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
|
|
|
|
2018-11-07 10:10:07 +01: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-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
|
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
|
|
|
|
2020-03-17 13:39:43 +01:00
|
|
|
USER gnuhealth
|
|
|
|
CMD /srv/gnuhealth/gnuhealth/tryton/server/trytond-current/bin/trytond --verbose
|