Add UID/GID for OpenMapKit, change path from omk to openmapkit
This commit is contained in:
parent
d973836b8c
commit
ae2eea1933
@ -2,16 +2,15 @@
|
|||||||
|
|
||||||
SOURCE_DIR=$(realpath $(dirname "${0}"))/openmapkit
|
SOURCE_DIR=$(realpath $(dirname "${0}"))/openmapkit
|
||||||
|
|
||||||
# Prepare Docker mount structure
|
# Build Docker container
|
||||||
mkdir -p /srv/omk/data/{deployments,submissions}
|
docker build -t openmapkit ${SOURCE_DIR}
|
||||||
|
|
||||||
# Configure OpenMapKit
|
# Configure OpenMapKit
|
||||||
export OMK_ADMIN_USER="admin"
|
export OMK_ADMIN_USER="admin"
|
||||||
export OMK_ADMIN_PWD=$(head -c 12 /dev/urandom | base64)
|
export OMK_ADMIN_PWD=$(head -c 12 /dev/urandom | base64)
|
||||||
envsubst <${SOURCE_DIR}/srv/omk/settings.js >/srv/omk/settings.js
|
mkdir -p /srv/openmapkit/data/{deployments,submissions}
|
||||||
|
envsubst <${SOURCE_DIR}/srv/openmapkit/settings.js >/srv/openmapkit/settings.js
|
||||||
# Build Docker container
|
chown -R 8007:8007 /srv/openmapkit/data
|
||||||
docker build -t openmapkit ${SOURCE_DIR}
|
|
||||||
|
|
||||||
# Configure OpenMapKit service
|
# Configure OpenMapKit service
|
||||||
cp ${SOURCE_DIR}/lib/systemd/system/openmapkit.service /lib/systemd/system/openmapkit.service
|
cp ${SOURCE_DIR}/lib/systemd/system/openmapkit.service /lib/systemd/system/openmapkit.service
|
||||||
@ -27,5 +26,5 @@ ln -s /etc/nginx/sites-available/openmapkit /etc/nginx/sites-enabled/openmapkit
|
|||||||
systemctl restart nginx
|
systemctl restart nginx
|
||||||
|
|
||||||
# Add portal application definition
|
# Add portal application definition
|
||||||
portal-app-manager openmapkit "https://{host}:8007/" admin "${OMK_ADMIN_PWD}"
|
portal-app-manager openmapkit "https://{host}:8407/" admin "${OMK_ADMIN_PWD}"
|
||||||
portal-app-manager openmapkit-clients -p clienturl "http://{host}:8096"
|
portal-app-manager openmapkit-clients -p clienturl "http://{host}:8007"
|
||||||
|
@ -4,23 +4,22 @@ MAINTAINER Disassembler <disassembler@dasm.cz>
|
|||||||
RUN apk --no-cache add python2
|
RUN apk --no-cache add python2
|
||||||
|
|
||||||
RUN apk --no-cache add nodejs git build-base openjdk8-jre-base py2-pip \
|
RUN apk --no-cache add nodejs git build-base openjdk8-jre-base py2-pip \
|
||||||
&& git clone --depth 1 https://github.com/AmericanRedCross/OpenMapKitServer /srv/omk \
|
&& git clone --depth 1 https://github.com/AmericanRedCross/OpenMapKitServer /srv/openmapkit \
|
||||||
&& cd /srv/omk \
|
&& cd /srv/openmapkit \
|
||||||
&& git submodule update --init \
|
&& git submodule update --init \
|
||||||
&& pip install -r requirements.txt \
|
&& pip install -r requirements.txt \
|
||||||
&& npm install -g yarn \
|
&& npm install -g yarn \
|
||||||
&& npm install libxmljs \
|
&& npm install libxmljs \
|
||||||
&& yarn \
|
&& yarn \
|
||||||
&& addgroup -S omk \
|
&& addgroup -S -g 8007 omk \
|
||||||
&& adduser -S -h /srv/omk -H -s /bin/sh -g omk -G omk omk \
|
&& adduser -S -u 8007 -h /srv/openmapkit -s /bin/false -g omk -G omk omk \
|
||||||
&& chown -R omk:omk /srv/omk/data/deployments /srv/omk/data/submissions \
|
|
||||||
&& apk --no-cache del git build-base py2-pip \
|
&& apk --no-cache del git build-base py2-pip \
|
||||||
&& rm -rf /srv/omk/.git* /srv/omk/api/odk/pyxform/.git* \
|
&& rm -rf /srv/openmapkit/.git* /srv/openmapkit/api/odk/pyxform/.git* \
|
||||||
&& rm -rf /root/* || true
|
&& rm -rf /root/* || true
|
||||||
|
|
||||||
VOLUME ["/srv/omk/data"]
|
VOLUME ["/srv/openmapkit/data"]
|
||||||
EXPOSE 3210
|
EXPOSE 8007
|
||||||
|
|
||||||
USER omk
|
USER omk
|
||||||
ENV NODE_ENV production
|
ENV NODE_ENV production
|
||||||
CMD ["node", "/srv/omk/server.js"]
|
CMD ["node", "/srv/openmapkit/server.js"]
|
||||||
|
@ -4,7 +4,7 @@ After=network.target
|
|||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
ExecStart=/usr/bin/docker run --rm --tmpfs /tmp --name openmapkit -v /srv/omk/settings.js:/srv/omk/settings.js -v /srv/omk/data:/srv/omk/data openmapkit
|
ExecStart=/usr/bin/docker run --rm --tmpfs /tmp --name openmapkit -v /srv/openmapkit/settings.js:/srv/openmapkit/settings.js -v /srv/openmapkit/data:/srv/openmapkit/data openmapkit
|
||||||
ExecStop=/usr/bin/docker kill openmapkit
|
ExecStop=/usr/bin/docker kill openmapkit
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'OpenMapKit Server',
|
name: 'OpenMapKit Server',
|
||||||
description: 'OpenMapKit Server is the lightweight server component of OpenMapKit that handles the collection and aggregation of OpenStreetMap and OpenDataKit data.',
|
description: 'OpenMapKit Server is the lightweight server component of OpenMapKit that handles the collection and aggregation of OpenStreetMap and OpenDataKit data.',
|
||||||
port: 8096,
|
port: 8007,
|
||||||
dataDir: __dirname + '/data',
|
dataDir: __dirname + '/data',
|
||||||
pagesDir: __dirname + '/pages',
|
pagesDir: __dirname + '/pages',
|
||||||
hostUrl: 'http://posm.io',
|
hostUrl: 'http://posm.io',
|
Loading…
Reference in New Issue
Block a user