2020-10-22 23:00:34 +02:00
|
|
|
IMAGE openmapkit_0.12.0-201021
|
|
|
|
FROM alpine3.10-nodejs10_10.19.0-201021
|
2020-03-22 12:17:13 +01:00
|
|
|
# libxmljs installation fails on nodejs>10
|
2018-09-13 14:07:44 +02:00
|
|
|
|
|
|
|
RUN EOF
|
2019-11-30 09:59:32 +01:00
|
|
|
# Install runtime dependencies
|
2020-03-22 11:08:52 +01:00
|
|
|
apk --no-cache add python2 openjdk8-jre-base
|
2019-11-30 09:59:32 +01:00
|
|
|
|
2018-09-13 14:07:44 +02:00
|
|
|
# Install build dependencies
|
2020-06-21 17:02:10 +02:00
|
|
|
apk --no-cache add --virtual .deps build-base git npm py2-pip yarn
|
2018-09-13 14:07:44 +02:00
|
|
|
|
|
|
|
# Clone OpenMapKit
|
2020-03-22 10:28:57 +01:00
|
|
|
git clone --recursive --depth 1 https://github.com/posm/OpenMapKitServer /srv/openmapkit
|
2018-09-13 14:07:44 +02:00
|
|
|
|
|
|
|
# Install OpenMapKit dependencies
|
2020-03-22 10:28:57 +01:00
|
|
|
cd /srv/openmapkit
|
2018-09-13 14:07:44 +02:00
|
|
|
pip install -r requirements.txt
|
2020-06-21 17:02:10 +02:00
|
|
|
npm install
|
2018-09-13 14:07:44 +02:00
|
|
|
cd frontend
|
|
|
|
yarn
|
|
|
|
yarn build
|
|
|
|
|
|
|
|
# Create OS user
|
2019-10-14 07:59:06 +02:00
|
|
|
addgroup -S -g 8080 omk
|
|
|
|
adduser -S -u 8080 -h /srv/openmapkit -s /bin/false -g omk -G omk omk
|
2018-09-13 14:07:44 +02:00
|
|
|
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-21 11:04:12 +02:00
|
|
|
# s6 required for single service due to inability of nodejs to process signals when running as PID 1
|
2020-03-22 10:28:57 +01:00
|
|
|
COPY image.d
|
2018-09-18 16:27:42 +02:00
|
|
|
|
2020-02-09 15:54:46 +01:00
|
|
|
CMD /bin/s6-svscan /etc/services.d
|