From 719c8301546c6747e147f04f74c08084d51d2a4d Mon Sep 17 00:00:00 2001 From: Clinton Werth Date: Wed, 11 Jun 2025 07:54:46 -0500 Subject: [PATCH 1/4] wip --- Dockerfile | 112 +++++++++-------------------------------------------- 1 file changed, 18 insertions(+), 94 deletions(-) diff --git a/Dockerfile b/Dockerfile index 396b97227..5e88d5194 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,101 +1,25 @@ -FROM node:20.11.1 AS build-service +FROM registry1.dso.mil/ironbank/opensource/nodejs/debian/nodejs:20.11.1 -WORKDIR /service -COPY service/package*.json ./ -RUN npm install -COPY service/ ./ -RUN npm run build +LABEL author="NGA" -RUN npm pack +USER root -# Build web-app -FROM node:20.11.1 AS build-webapp +RUN apt-get update -WORKDIR /web-app -COPY web-app/package*.json ./ -RUN npm install -COPY web-app/ ./ -RUN npm run build +RUN groupadd -r mage \ + && useradd -m -r -s /bin/bash -g mage mage \ + && mkdir -p /var/lib/mage \ + && chown mage:mage /var/lib/mage -RUN npm pack ./dist +USER mage +ENV MAGE_HOME=/home/mage/instance +WORKDIR ${MAGE_HOME} +RUN ls -l \ + && npm i --omit dev @ngageoint/mage.service@6.2.9 \ + && npm i --omit dev @ngageoint/mage.web-app@6.2.9 \ + && ln -s ./node_modules/.bin/mage.service -FROM node:20.11.1 AS build-arcwebplugin -# Build arcgis service plugin -WORKDIR /arcgiswebplugin -COPY plugins/arcgis/web-app/package*.json ./ -RUN npm install -COPY --from=build-service /service /arcgiswebplugin/node_modules/@ngageoint/mage.service -COPY --from=build-service /service /arcgiswebplugin/node_modules/@ngageoint/mage.service -COPY plugins/arcgis/web-app/ ./ -RUN npm run build -RUN npm pack ./dist/main +VOLUME /var/lib/mage +EXPOSE 4242 -FROM node:20.11.1 AS build-arcserviceplugin -WORKDIR /arcgisserviceplugin -COPY plugins/arcgis/service/package*.json ./ -RUN npm install -COPY --from=build-service /service /arcgisserviceplugin/node_modules/@ngageoint/mage.service -COPY plugins/arcgis/service/ ./ -RUN npm run build -RUN npm pack - -# FROM node:20.11.1 AS build-imageserviceplugin -# WORKDIR /imageserviceplugin -# COPY plugins/image/service/package*.json ./ -# RUN npm install -# COPY --from=build-service /service /imageserviceplugin/node_modules/@ngageoint/mage.service -# RUN rm -rf /imageserviceplugin/node_modules/@ngageoint/mage.service/node_modules/mongoose -# COPY plugins/image/service/ ./ -# RUN npm run build -# RUN npm pack - -FROM node:20.11.1 AS build-sftpserviceplugin -WORKDIR /sftpserviceplugin -COPY plugins/sftp/service/package*.json ./ -RUN npm install -COPY --from=build-service /service /sftpserviceplugin/node_modules/@ngageoint/mage.service -COPY plugins/sftp/service/ ./ -COPY --from=build-service /service /sftpserviceplugin/node_modules/@ngageoint/mage.service -COPY plugins/sftp/service/ ./ -RUN npm run build -RUN npm pack - -FROM node:20.11.1 AS build-sftpwebplugin -# Build sftp service plugin -WORKDIR /sftpwebplugin -COPY plugins/sftp/web/package*.json ./ -RUN npm install -COPY plugins/sftp/web/ ./ -RUN npm run build -RUN npm pack ./dist/main - -# Build instance -FROM node:20.11.1 AS build-instance -COPY --from=build-service /service/ngageoint*.tgz /service/ -COPY --from=build-webapp /web-app/ngageoint*.tgz /web-app/ -COPY --from=build-arcwebplugin /arcgiswebplugin/ngageoint*.tgz /arcgiswebplugin/ -COPY --from=build-arcserviceplugin /arcgisserviceplugin/ngageoint*.tgz /arcgisserviceplugin/ -COPY --from=build-sftpserviceplugin /sftpserviceplugin/ngageoint*.tgz /sftpserviceplugin/ -COPY --from=build-sftpwebplugin /sftpwebplugin/ngageoint*.tgz /sftpwebplugin/ - -WORKDIR /instance -RUN ls -la ../sftpwebplugin -RUN npm install ../service/ngageoint-mage.service*.tgz -RUN npm install ../web-app/ngageoint-mage.web-app*.tgz -RUN npm install ../sftpwebplugin/ngageoint-mage.sftp.web*.tgz -RUN npm install ../sftpserviceplugin/ngageoint-mage.sftp.service*.tgz -RUN npm install ../arcgiswebplugin/ngageoint*.tgz -RUN npm install ../arcgisserviceplugin/ngageoint*.tgz - - -ENV NODE_PATH=./node_modules -ENTRYPOINT [ \ - "./node_modules/.bin/mage.service", \ - "--plugin", "@ngageoint/mage.image.service", \ - "--plugin", "@ngageoint/mage.arcgis.service", \ - "--plugin", "@ngageoint/mage.sftp.service", \ - "--web-plugin", "@ngageoint/mage.sftp.web", \ - "--plugin", "@ngageoint/mage.sftp.service", \ - "--web-plugin", "@ngageoint/mage.sftp.web", \ - "--web-plugin", "@ngageoint/mage.arcgis.web-app" \ - ] \ No newline at end of file +ENTRYPOINT [ "./mage.service" ] From 24a95c13d8c5d75a2e8bb64c9213aaf7e43262f1 Mon Sep 17 00:00:00 2001 From: Clinton Werth Date: Wed, 11 Jun 2025 07:57:49 -0500 Subject: [PATCH 2/4] update image base --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5e88d5194..c011e2878 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM registry1.dso.mil/ironbank/opensource/nodejs/debian/nodejs:20.11.1 +FROM node:20.11.1 LABEL author="NGA" @@ -22,4 +22,4 @@ RUN ls -l \ VOLUME /var/lib/mage EXPOSE 4242 -ENTRYPOINT [ "./mage.service" ] +ENTRYPOINT [ "./mage.service" ] \ No newline at end of file From e628192d0dafcdbe5319bb500d26acb16f525d8b Mon Sep 17 00:00:00 2001 From: Clinton Werth Date: Wed, 11 Jun 2025 08:09:40 -0500 Subject: [PATCH 3/4] update node version --- Dockerfile | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index c011e2878..8289b1daa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:20.11.1 +FROM node:18 LABEL author="NGA" @@ -14,10 +14,9 @@ RUN groupadd -r mage \ USER mage ENV MAGE_HOME=/home/mage/instance WORKDIR ${MAGE_HOME} -RUN ls -l \ - && npm i --omit dev @ngageoint/mage.service@6.2.9 \ - && npm i --omit dev @ngageoint/mage.web-app@6.2.9 \ - && ln -s ./node_modules/.bin/mage.service +RUN npm install @ngageoint/mage.service@6.2.9 +RUN npm install @ngageoint/mage.web-app@6.2.9 +RUN ln -s ./node_modules/.bin/mage.service VOLUME /var/lib/mage EXPOSE 4242 From 54c2b6bb8b329a85cd4dd11a827750b926c33d01 Mon Sep 17 00:00:00 2001 From: Clinton Werth Date: Wed, 11 Jun 2025 08:27:49 -0500 Subject: [PATCH 4/4] 6.2.13 --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8289b1daa..508a85572 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,8 +14,8 @@ RUN groupadd -r mage \ USER mage ENV MAGE_HOME=/home/mage/instance WORKDIR ${MAGE_HOME} -RUN npm install @ngageoint/mage.service@6.2.9 -RUN npm install @ngageoint/mage.web-app@6.2.9 +RUN npm install @ngageoint/mage.service@6.2.13 +RUN npm install @ngageoint/mage.web-app@6.2.13 RUN ln -s ./node_modules/.bin/mage.service VOLUME /var/lib/mage