2018-03-30 21:58:04 +02:00
|
|
|
FROM java
|
2017-12-12 13:29:33 +01:00
|
|
|
MAINTAINER Disassembler <disassembler@dasm.cz>
|
|
|
|
|
2018-01-08 21:04:35 +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
|
2018-01-29 16:47:27 +01:00
|
|
|
&& apk --no-cache del paxctl
|
2018-01-08 21:04:35 +01:00
|
|
|
|
2017-12-21 10:39:35 +01:00
|
|
|
RUN \
|
2018-04-29 21:58:33 +02:00
|
|
|
# Install runtime dependencies
|
2018-04-30 22:57:50 +02:00
|
|
|
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-03-26 19:53:54 +02:00
|
|
|
apk --no-cache add --virtual .deps build-base git py2-pip \
|
2017-12-21 10:39:35 +01:00
|
|
|
# Clone OpenMapKit
|
2018-04-21 23:10:55 +02:00
|
|
|
&& git clone --depth 1 https://github.com/posm/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 \
|
2018-03-26 19:53:54 +02:00
|
|
|
&& npm install \
|
2017-12-21 10:39:35 +01:00
|
|
|
# Create OS user
|
2017-12-13 17:16:08 +01:00
|
|
|
&& addgroup -S -g 8007 omk \
|
2018-04-21 23:10:55 +02:00
|
|
|
&& adduser -S -u 8007 -h /srv/openmapkit -s /bin/false -g omk -G omk omk \
|
|
|
|
&& chown -R omk:omk /srv/openmapkit \
|
2017-12-21 10:39:35 +01:00
|
|
|
# Cleanup
|
2018-01-29 16:47:27 +01:00
|
|
|
&& apk --no-cache del .deps \
|
2018-04-21 23:10:55 +02:00
|
|
|
&& find /srv/openmapkit -name '.git*' -exec rm -rf {} + \
|
2017-12-22 17:45:03 +01:00
|
|
|
&& rm -rf /usr/local/share/.cache \
|
2018-01-24 16:28:41 +01:00
|
|
|
&& rm -rf /root/.cache /root/.config /root/.node-gyp /root/.npm
|
2017-12-12 13:29:33 +01:00
|
|
|
|
2018-04-29 21:58:33 +02:00
|
|
|
COPY docker/ /
|
|
|
|
|
2018-04-21 23:10:55 +02:00
|
|
|
VOLUME ["/srv/openmapkit/data"]
|
2018-03-25 23:17:58 +02:00
|
|
|
EXPOSE 8080
|
2017-12-12 13:29:33 +01:00
|
|
|
|
2018-04-29 21:58:33 +02:00
|
|
|
CMD ["s6-svscan", "/etc/services.d"]
|