-
Notifications
You must be signed in to change notification settings - Fork 52
Expand file tree
/
Copy pathDockerfile.published
More file actions
44 lines (37 loc) · 1.56 KB
/
Copy pathDockerfile.published
File metadata and controls
44 lines (37 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Assemble a Mage server instance image from packages published in the NPM registry.
ARG BUILD_IMAGE="node:24-slim"
ARG DIST_IMAGE="ghcr.io/ngageoint/mage-server/ironbank/google/distroless13/nodejs-24:nonroot"
ARG MAGE_INSTANCE="/mage/instance"
FROM ${BUILD_IMAGE} AS build-instance
LABEL author="NGA"
ARG CORE_VERSION="latest"
ARG ARCGIS_VERSION="latest"
ARG SFTP_VERSION="latest"
ARG MSI_VERSION="latest"
ARG IMAGE_VERSION="latest"
ARG MAGE_INSTANCE
WORKDIR ${MAGE_INSTANCE}
RUN set -eux; \
npm i --omit=dev @ngageoint/mage.service@${CORE_VERSION}; \
npm i --omit=dev @ngageoint/mage.web-app@${CORE_VERSION}; \
[ -n "${ARCGIS_VERSION}" ] && \
npm i --omit=dev @ngageoint/mage.arcgis.service@${ARCGIS_VERSION} @ngageoint/mage.arcgis.web-app@${ARCGIS_VERSION}; \
[ -n "${SFTP_VERSION}" ] && \
npm i --omit=dev @ngageoint/mage.sftp.service@${SFTP_VERSION} @ngageoint/mage.sftp.web@${SFTP_VERSION}; \
[ -n "${MSI_VERSION}" ] && \
npm i --omit=dev @ngageoint/mage.nga-msi@${MSI_VERSION}; \
[ -n "${IMAGE_VERSION}" ] && \
npm i --omit=dev @ngageoint/mage.image.service@${IMAGE_VERSION}; \
ln -sfn ./node_modules/.bin/mage.service ./mage.service
FROM ${DIST_IMAGE}
ARG MAGE_INSTANCE
# create the mage data base directory as DIST_IMAGE nonroot user
WORKDIR /var/lib/mage
# set user to 999 as historically mage images were built with user/group 999
# and 999 owns the files of existing deployments
USER 999:999
COPY --chown=999:999 --from=build-instance ${MAGE_INSTANCE}/ ${MAGE_INSTANCE}/
WORKDIR ${MAGE_INSTANCE}
VOLUME /var/lib/mage
EXPOSE 4242
CMD [ "./mage.service" ]