53 lines
2.0 KiB
Docker
53 lines
2.0 KiB
Docker
FROM alpine:3.7
|
|
MAINTAINER Disassembler <disassembler@dasm.cz>
|
|
|
|
RUN \
|
|
# Install Python3 runtime
|
|
apk --no-cache add python3
|
|
|
|
RUN \
|
|
# Install runtime XML dependencies
|
|
apk --no-cache add libxml2 libxslt
|
|
|
|
RUN \
|
|
# Install runtime dependencies
|
|
apk --no-cache add bash coreutils libffi libjpeg-turbo libpq nodejs \
|
|
# Install build dependencies
|
|
&& 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 \
|
|
# 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 \
|
|
# Symlink python binary
|
|
&& ln -s /usr/bin/python3 /usr/bin/python \
|
|
# 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 \
|
|
# 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
|
|
&& apk del .deps \
|
|
&& find /srv/gnuhealth -name '.git*' -exec rm -rf {} + \
|
|
&& rm -rf /usr/local/share/.cache \
|
|
&& rm -rf /root \
|
|
&& mkdir /root
|
|
|
|
VOLUME ["/srv/gnuhealth/gnuhealth/tryton/server/config"]
|
|
EXPOSE 8008
|
|
|
|
USER gnuhealth
|
|
ENV PATH=/srv/gnuhealth/gnuhealth/tryton/server/trytond-4.2.8/bin:${PATH} \
|
|
TRYTOND_CONFIG=/srv/gnuhealth/gnuhealth/tryton/server/config/trytond.conf \
|
|
PYTHONPATH=/srv/gnuhealth/gnuhealth/tryton/server/trytond-4.2.8:/srv/gnuhealth/gnuhealth/tryton/server/config
|
|
CMD ["trytond", "--verbose"]
|