diff --git a/omk.sh b/omk.sh index f52b29d..00567dd 100755 --- a/omk.sh +++ b/omk.sh @@ -8,8 +8,9 @@ docker build -t omk ${SOURCE_DIR} # Configure OpenMapKit export OMK_ADMIN_USER="admin" export OMK_ADMIN_PWD=$(head -c 12 /dev/urandom | base64) -mkdir -p /srv/omk/conf /srv/omk/data/deployments /srv/omk/data/forms /srv/omk/data/submissions +mkdir -p /srv/omk/conf /srv/omk/data chown -R 8007:8007 /srv/omk/data +docker run --rm -v /srv/omk/data:/mnt/data omk cp -rp /srv/omk/data/. /mnt/data envsubst <${SOURCE_DIR}/srv/omk/conf/settings.js >/srv/omk/conf/settings.js # Configure OpenMapKit service @@ -18,6 +19,6 @@ rc-update add omk service omk start # Add application definition -spotter-appmgr add-app omk "https://omk.{host}/" admin "${OMK_ADMIN_PWD}" +spotter-appmgr add-app omk "https://omk.{host}/" "${OMK_ADMIN_USER}" "${OMK_ADMIN_PWD}" spotter-appmgr add-app omk-clients -p clienturl "https://omk.{host}" spotter-appmgr add-app geoodk-clients -p clienturl "https://omk.{host}" diff --git a/omk/Dockerfile b/omk/Dockerfile index 238d8fe..6e2f9ce 100644 --- a/omk/Dockerfile +++ b/omk/Dockerfile @@ -24,15 +24,15 @@ RUN \ RUN \ # Install build dependencies - apk --no-cache add --virtual .deps build-base git py2-pip yarn \ + apk --no-cache add --virtual .deps build-base git py2-pip \ # Clone OpenMapKit - && git clone --depth 1 https://github.com/AmericanRedCross/OpenMapKitServer /srv/omk \ + && git clone --depth 1 https://github.com/posm/OpenMapKitServer /srv/omk \ && cd /srv/omk \ && git submodule update --init \ # Install OpenMapKit dependencies && pip install -r requirements.txt \ && npm install libxmljs \ - && yarn \ + && npm install \ # Create OS user && addgroup -S -g 8007 omk \ && adduser -S -u 8007 -h /srv/omk -s /bin/false -g omk -G omk omk \