Spotter-VM/lxc-apps/openmapkit/lxcfile

43 lines
1.1 KiB
Plaintext

IMAGE openmapkit_0.12.0-190620
LAYER alpine3.9_3.9.4-190620
LAYER alpine3.9-java8_8.212.04-190620
LAYER alpine3.9-python2.7_2.7.16-190620
LAYER alpine3.9-nodejs10_10.14.2-190620
MERGE /usr/bin/lxcmerge
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 #TODO: Why does this fail?
# Install OpenMapKit dependencies
pip install -r requirements.txt
yarn add libxmljs
yarn
cd frontend
yarn
yarn build
# Create OS user
addgroup -S -g 8080 omk
adduser -S -u 8080 -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
# s6 required for single service due to inability of nodejs to process signals when running as PID 1
COPY lxc
CMD s6-svscan /etc/services.d