@leverege/build-tools 2.116.0 → 2.117.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leverege/build-tools",
3
- "version": "2.116.0",
3
+ "version": "2.117.0",
4
4
  "description": "A collection of build / support tools for Leverege developers",
5
5
  "main": "index.js",
6
6
  "repository": {
package/src/Docker.mjs CHANGED
@@ -148,6 +148,10 @@ const generateDockerfile = async ( options ) => {
148
148
  if ( fs.existsSync( dockerfilePrePlugin ) ) {
149
149
  settings.preInstallPluginfile = fs.readFileSync( dockerfilePrePlugin )
150
150
  }
151
+ const dockerfileFinalStagePrePlugin = './docker/DockerfileFinalStagePreInstall.plugin'
152
+ if ( fs.existsSync( dockerfileFinalStagePrePlugin ) ) {
153
+ settings.finalStagePreInstallPluginfile = fs.readFileSync( dockerfileFinalStagePrePlugin )
154
+ }
151
155
 
152
156
  const compiled = handlebars.compile( dockerfileTemplate, { noEscape : true } )
153
157
  const replaced = compiled( settings )
@@ -129,7 +129,7 @@ const dockerfileOptions = {
129
129
  isNpmWorkspace,
130
130
  buildEnv : leveregeStanza.buildEnv || leveregeStanza['build-env'] || 'alpine',
131
131
  imageBase : leveregeStanza.imageBase || leveregeStanza['image-base'],
132
- runuser : leveregeStanza.runUser || leveregeStanza['run-user'] || isNodeJsProject ? 'node' : 'python',
132
+ runuser : leveregeStanza.runUser || leveregeStanza['run-user'] || ( isNodeJsProject ? 'node' : 'python' ),
133
133
  nodeimage : leveregeStanza.nodeimg, // left as nodeimg in package.json for backwards compat
134
134
  regvers : repoDescr.packageVersion,
135
135
  pythonVersion : repoDescr.rootPyProjectToml?.pythonVersion,
@@ -70,6 +70,7 @@ RUN npm ci --only=production --no-optional {{npmlogging}} && \
70
70
  # --------------------------------------------------------------
71
71
 
72
72
  FROM {{image}}
73
+ {{finalStagePreInstallPluginfile}}
73
74
 
74
75
  ARG BUILD_ENV="{{buildEnv}}"
75
76
 
@@ -97,7 +98,7 @@ RUN if [ "$BUILD_ENV" = "debian" ]; then \
97
98
  npm install -g {{npmVersion}} && \
98
99
  {{/if}}
99
100
  rm /bin/sh && ln -s /bin/bash /bin/sh && \
100
- mkdir -p /usr/src/app /tmp/levlog && chown node:node /usr/src/app; \
101
+ mkdir -p /usr/src/app /tmp/levlog && chown {{runuser}}:{{runuser}} /usr/src/app; \
101
102
  else \
102
103
  apk update && \
103
104
  apk add --no-cache bash curl tini vim {{apkadds}} && \
@@ -108,7 +109,7 @@ RUN if [ "$BUILD_ENV" = "debian" ]; then \
108
109
  npm install -g {{npmVersion}} && \
109
110
  {{/if}}
110
111
  rm /bin/sh && ln -s /bin/bash /bin/sh && \
111
- mkdir -p /usr/src/app /tmp/levlog && chown node:node /usr/src/app; \
112
+ mkdir -p /usr/src/app /tmp/levlog && chown {{runuser}}:{{runuser}} /usr/src/app; \
112
113
  fi
113
114
 
114
115
 
@@ -125,8 +126,8 @@ RUN rm -f ${NPM_CONFIG_USERCONFIG}
125
126
  ENTRYPOINT [ "tini", "--" ]
126
127
  WORKDIR /usr/src/app
127
128
 
128
- COPY --chown=node:node --from=intermediate /usr/src/app /usr/src/app
129
+ COPY --chown={{runuser}}:{{runuser}} --from=intermediate /usr/src/app /usr/src/app
129
130
 
130
131
  USER {{runuser}}
131
- COPY ./bashrc /home/node/.bashrc
132
- CMD [ "/bin/bash", "-c", "source /home/node/.bashrc && {{runCommand}}" ]
132
+ COPY --chown={{runuser}}:{{runuser}} ./bashrc /home/{{runuser}}/.bashrc
133
+ CMD [ "/bin/bash", "-c", "source /home/{{runuser}}/.bashrc && {{runCommand}}" ]