2018-04-30 22:57:50 +02:00
|
|
|
FROM alpine
|
2017-12-29 16:31:48 +01:00
|
|
|
MAINTAINER Disassembler <disassembler@dasm.cz>
|
|
|
|
|
|
|
|
RUN \
|
|
|
|
# Install Python3 runtime
|
2018-01-11 11:10:12 +01:00
|
|
|
apk --no-cache add python3 \
|
|
|
|
&& ln -s /usr/bin/python3 /usr/bin/python
|
2017-12-29 16:31:48 +01:00
|
|
|
|
|
|
|
RUN \
|
|
|
|
# Install runtime XML dependencies
|
|
|
|
apk --no-cache add libxml2 libxslt
|
|
|
|
|
2018-02-01 11:54:17 +01:00
|
|
|
RUN \
|
|
|
|
# Install NodeJS runtime
|
|
|
|
apk --no-cache add nodejs paxctl \
|
|
|
|
# Fix grsec attributes to loosen memory protection restrictions
|
|
|
|
&& paxctl -cm /usr/bin/node \
|
|
|
|
# Cleanup
|
|
|
|
&& apk --no-cache del paxctl
|
|
|
|
|
2017-12-29 16:31:48 +01:00
|
|
|
RUN \
|
|
|
|
# Install runtime dependencies
|
2018-02-01 11:54:17 +01:00
|
|
|
apk --no-cache add bash coreutils libffi libjpeg-turbo libpq
|
2018-01-08 21:04:35 +01:00
|
|
|
|
|
|
|
RUN \
|
2017-12-29 16:31:48 +01:00
|
|
|
# Install build dependencies
|
2018-01-08 21:04:35 +01:00
|
|
|
apk --no-cache add --virtual .deps build-base git libffi-dev libjpeg-turbo-dev libxml2-dev libxslt-dev ncurses patch postgresql-dev python3-dev sudo \
|
2017-12-29 16:31:48 +01:00
|
|
|
# Download GNU Health
|
|
|
|
&& wget http://ftp.gnu.org/gnu/health/gnuhealth-3.2.8.tar.gz -O /tmp/gnuhealth.tgz \
|
|
|
|
&& tar xzf /tmp/gnuhealth.tgz -C /srv \
|
|
|
|
&& mv /srv/gnuhealth-3.2.8 /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 \
|
2018-01-11 11:10:12 +01:00
|
|
|
# Create OS user
|
2017-12-29 16:31:48 +01:00
|
|
|
&& 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 \
|
2018-02-06 10:26:56 +01:00
|
|
|
# Hackfix template1 database lock
|
2018-03-25 22:36:44 +02:00
|
|
|
&& sed -i 's/template1/gnuhealth/g' /srv/gnuhealth/gnuhealth/tryton/server/trytond-4.2.10/trytond/backend/postgresql/database.py \
|
2017-12-29 16:31:48 +01: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 \
|
|
|
|
# Cleanup
|
2018-01-29 16:47:27 +01:00
|
|
|
&& apk --no-cache del .deps \
|
2017-12-29 16:31:48 +01:00
|
|
|
&& find /srv/gnuhealth -name '.git*' -exec rm -rf {} + \
|
2018-01-24 16:28:41 +01:00
|
|
|
&& rm -rf /usr/local/share/.cache
|
2017-12-29 16:31:48 +01:00
|
|
|
|
|
|
|
VOLUME ["/srv/gnuhealth/gnuhealth/tryton/server/config"]
|
2018-03-25 23:10:39 +02:00
|
|
|
EXPOSE 8080
|
2017-12-29 16:31:48 +01:00
|
|
|
|
|
|
|
USER gnuhealth
|
2018-03-25 22:36:44 +02:00
|
|
|
ENV PATH=/srv/gnuhealth/gnuhealth/tryton/server/trytond-4.2.10/bin:${PATH} \
|
2017-12-29 16:31:48 +01:00
|
|
|
TRYTOND_CONFIG=/srv/gnuhealth/gnuhealth/tryton/server/config/trytond.conf \
|
2018-03-25 22:36:44 +02:00
|
|
|
PYTHONPATH=/srv/gnuhealth/gnuhealth/tryton/server/trytond-4.2.10:/srv/gnuhealth/gnuhealth/tryton/server/config
|
2017-12-29 16:31:48 +01:00
|
|
|
CMD ["trytond", "--verbose"]
|