2018-09-13 14:07:44 +02:00
|
|
|
IMAGE openmapkit
|
|
|
|
LAYER shared/alpine
|
|
|
|
LAYER shared/java
|
|
|
|
LAYER shared/libxml
|
|
|
|
LAYER shared/python2
|
|
|
|
LAYER shared/nodejs
|
|
|
|
LAYER openmapkit/openmapkit
|
|
|
|
|
|
|
|
FIXLAYER /usr/bin/fix-apk
|
|
|
|
|
|
|
|
RUN EOF
|
|
|
|
# Install build dependencies
|
|
|
|
apk --no-cache add --virtual .deps build-base git py2-pip yarn
|
|
|
|
|
|
|
|
# Clone OpenMapKit
|
|
|
|
git clone --depth 1 https://github.com/posm/OpenMapKitServer /srv/openmapkit
|
|
|
|
cd /srv/openmapkit
|
|
|
|
git submodule update --init
|
|
|
|
|
|
|
|
# Install OpenMapKit dependencies
|
|
|
|
pip install -r requirements.txt
|
|
|
|
yarn
|
|
|
|
cd frontend
|
|
|
|
yarn
|
|
|
|
yarn build
|
|
|
|
|
|
|
|
# Create OS user
|
|
|
|
addgroup -S -g 8007 omk
|
|
|
|
adduser -S -u 8007 -h /srv/openmapkit -s /bin/false -g omk -G omk omk
|
|
|
|
chown -R omk:omk /srv/openmapkit
|
|
|
|
|
|
|
|
# Cleanup
|
|
|
|
apk --no-cache del .deps
|
|
|
|
find /srv/openmapkit -name '.git*' -exec rm -rf {} +
|
|
|
|
rm -rf /usr/local/share/.cache
|
|
|
|
rm -rf /root/.cache /root/.config /root/.node-gyp /root/.npm
|
|
|
|
EOF
|
|
|
|
|
2018-09-13 14:58:03 +02:00
|
|
|
MOUNT /srv/openmapkit/conf/settings.js srv/openmapkit/settings.js
|
2018-09-13 14:07:44 +02:00
|
|
|
MOUNT /srv/openmapkit/data srv/openmapkit/data
|
|
|
|
|
|
|
|
USER 8007 8007
|
|
|
|
ENV NODE_ENV production
|
|
|
|
CMD /usr/bin/node /srv/openmapkit/server.js
|