2017-12-12 13:29:33 +01:00
|
|
|
FROM alpine:3.7
|
|
|
|
MAINTAINER Disassembler <disassembler@dasm.cz>
|
|
|
|
|
2018-01-08 21:04:35 +01:00
|
|
|
RUN \
|
|
|
|
# Install Java 1.8 JRE
|
|
|
|
apk --no-cache add openjdk8-jre-base paxctl \
|
|
|
|
# Fix grsec attributes to loosen memory protection restrictions
|
|
|
|
&& paxctl -cm /usr/lib/jvm/java-1.8-openjdk/jre/bin/java \
|
|
|
|
&& paxctl -cm /usr/lib/jvm/java-1.8-openjdk/bin/java \
|
|
|
|
# Cleanup
|
|
|
|
&& apk del paxctl
|
|
|
|
|
|
|
|
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 del paxctl
|
|
|
|
|
2017-12-21 10:39:35 +01:00
|
|
|
RUN \
|
|
|
|
# Install Python2 runtime
|
|
|
|
apk --no-cache add python2
|
2017-12-12 13:29:33 +01:00
|
|
|
|
2017-12-21 10:39:35 +01:00
|
|
|
RUN \
|
|
|
|
# Install build dependencies
|
2018-01-08 21:04:35 +01:00
|
|
|
apk --no-cache add --virtual .deps git build-base py2-pip yarn \
|
2017-12-21 10:39:35 +01:00
|
|
|
# Clone OpenMapKit
|
2017-12-13 17:16:08 +01:00
|
|
|
&& git clone --depth 1 https://github.com/AmericanRedCross/OpenMapKitServer /srv/openmapkit \
|
|
|
|
&& cd /srv/openmapkit \
|
2017-12-12 13:29:33 +01:00
|
|
|
&& git submodule update --init \
|
2017-12-21 10:39:35 +01:00
|
|
|
# Install OpenMapKit dependencies
|
2017-12-12 13:29:33 +01:00
|
|
|
&& pip install -r requirements.txt \
|
|
|
|
&& npm install libxmljs \
|
|
|
|
&& yarn \
|
2017-12-21 10:39:35 +01:00
|
|
|
# Create OS user
|
2017-12-13 17:16:08 +01:00
|
|
|
&& addgroup -S -g 8007 omk \
|
|
|
|
&& adduser -S -u 8007 -h /srv/openmapkit -s /bin/false -g omk -G omk omk \
|
2017-12-25 08:49:50 +01:00
|
|
|
&& chown -R omk:omk /srv/openmapkit \
|
2017-12-21 10:39:35 +01:00
|
|
|
# Cleanup
|
2018-01-08 21:04:35 +01:00
|
|
|
&& apk del .deps \
|
2017-12-13 17:16:08 +01:00
|
|
|
&& rm -rf /srv/openmapkit/.git* /srv/openmapkit/api/odk/pyxform/.git* \
|
2017-12-22 17:45:03 +01:00
|
|
|
&& rm -rf /usr/local/share/.cache \
|
2017-12-20 11:07:40 +01:00
|
|
|
&& rm -rf /root \
|
|
|
|
&& mkdir /root
|
2017-12-12 13:29:33 +01:00
|
|
|
|
2017-12-13 17:16:08 +01:00
|
|
|
VOLUME ["/srv/openmapkit/data"]
|
|
|
|
EXPOSE 8007
|
2017-12-12 13:29:33 +01:00
|
|
|
|
|
|
|
USER omk
|
|
|
|
ENV NODE_ENV production
|
2017-12-13 17:16:08 +01:00
|
|
|
CMD ["node", "/srv/openmapkit/server.js"]
|