@payfit/nx-core 5.19.4 → 5.19.5-ephemeral-fix-tini.1
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/dist/src/generators/init/docker/Dockerfile.template +1 -1
- package/dist/src/migrations/5.20.0/20260224-docker-tini-fix.d.ts +2 -0
- package/dist/src/migrations/5.20.0/20260224-docker-tini-fix.js +26 -0
- package/dist/src/migrations/5.20.0/20260224-docker-tini-fix.js.map +1 -0
- package/dist/src/migrations/5.20.0/Dockerfile.bad-tini +38 -0
- package/migrations.json +5 -0
- package/package.json +1 -1
|
@@ -43,6 +43,6 @@ COPY --from=builder /usr/src/app/node_modules node_modules
|
|
|
43
43
|
# COPY dist/apps/${PROJECTNAME}/packages packages
|
|
44
44
|
COPY dist/apps/${PROJECTNAME}/index.js .
|
|
45
45
|
|
|
46
|
-
ENTRYPOINT ["/sbin/tini", "--"]
|
|
46
|
+
ENTRYPOINT ["/sbin/tini", "--", "docker-entrypoint.sh"]
|
|
47
47
|
|
|
48
48
|
CMD ["node", "index"]
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = update;
|
|
4
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
5
|
+
const devkit_1 = require("@nx/devkit");
|
|
6
|
+
const logger_1 = require("../../utils/common/logger");
|
|
7
|
+
const path = require("node:path");
|
|
8
|
+
function update(tree) {
|
|
9
|
+
logger_1.consola.start('Updating Dockerfiles, fixing tini...');
|
|
10
|
+
const projects = (0, devkit_1.getProjects)(tree);
|
|
11
|
+
for (const [_, projectConfig] of projects.entries()) {
|
|
12
|
+
const dockerfilePath = path.join(projectConfig.root, 'Dockerfile');
|
|
13
|
+
if (tree.exists(dockerfilePath)) {
|
|
14
|
+
const dockerFileContent = tree.read(dockerfilePath, 'utf-8');
|
|
15
|
+
if (!dockerFileContent) {
|
|
16
|
+
continue;
|
|
17
|
+
}
|
|
18
|
+
const modifiedContent = dockerFileContent.replace(/^(\s*)ENTRYPOINT\s*\[\s*\"(?:(?:\/sbin\/)?tini)\"\s*,\s*\"--\"\s*\]\s*(#.*)?$/gm, '$1ENTRYPOINT ["/sbin/tini", "--", "docker-entrypoint.sh"]$2');
|
|
19
|
+
if (modifiedContent !== dockerFileContent) {
|
|
20
|
+
tree.write(dockerfilePath, modifiedContent);
|
|
21
|
+
logger_1.consola.success(`Dockerfile for ${projectConfig.name} updated successfully`);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=20260224-docker-tini-fix.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"20260224-docker-tini-fix.js","sourceRoot":"","sources":["../../../../src/migrations/5.20.0/20260224-docker-tini-fix.ts"],"names":[],"mappings":";;AAOA,yBA4BC;AAnCD,sDAAsD;AACtD,uCAA8C;AAE9C,sDAAmD;AAEnD,kCAAkC;AAElC,SAAwB,MAAM,CAAC,IAAU;IACvC,gBAAO,CAAC,KAAK,CAAC,sCAAsC,CAAC,CAAA;IAErD,MAAM,QAAQ,GAAG,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAA;IAElC,KAAK,MAAM,CAAC,CAAC,EAAE,aAAa,CAAC,IAAI,QAAQ,CAAC,OAAO,EAAE,EAAE,CAAC;QACpD,MAAM,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,YAAY,CAAC,CAAA;QAElE,IAAI,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE,CAAC;YAChC,MAAM,iBAAiB,GAAG,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,OAAO,CAAC,CAAA;YAE5D,IAAI,CAAC,iBAAiB,EAAE,CAAC;gBACvB,SAAQ;YACV,CAAC;YAED,MAAM,eAAe,GAAG,iBAAiB,CAAC,OAAO,CAC/C,iFAAiF,EACjF,6DAA6D,CAC9D,CAAA;YAED,IAAI,eAAe,KAAK,iBAAiB,EAAE,CAAC;gBAC1C,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE,eAAe,CAAC,CAAA;gBAC3C,gBAAO,CAAC,OAAO,CACb,kBAAkB,aAAa,CAAC,IAAI,uBAAuB,CAC5D,CAAA;YACH,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# syntax=docker/dockerfile:1
|
|
2
|
+
FROM node:24.13-alpine AS base
|
|
3
|
+
|
|
4
|
+
ARG APPNAME=files
|
|
5
|
+
|
|
6
|
+
FROM base AS builder
|
|
7
|
+
|
|
8
|
+
WORKDIR /usr/src/app
|
|
9
|
+
|
|
10
|
+
# Copy files for dependencies install
|
|
11
|
+
COPY .yarnrc.yml .
|
|
12
|
+
COPY .yarn .yarn
|
|
13
|
+
COPY dist/apps/${APPNAME}/package.json \
|
|
14
|
+
dist/apps/${APPNAME}/yarn.lock \
|
|
15
|
+
.
|
|
16
|
+
|
|
17
|
+
RUN --mount=type=cache,target=/usr/src/app/.yarn/cache \
|
|
18
|
+
--mount=type=secret,id=NPM_TOKEN,env=NPM_TOKEN \
|
|
19
|
+
yarn workspaces focus --production
|
|
20
|
+
|
|
21
|
+
FROM base AS production
|
|
22
|
+
|
|
23
|
+
WORKDIR /usr/src/app
|
|
24
|
+
|
|
25
|
+
ENV NODE_OPTIONS="--enable-source-maps --no-deprecation"
|
|
26
|
+
ENV NODE_ENV=production
|
|
27
|
+
|
|
28
|
+
ARG DD_GIT_REPOSITORY_URL
|
|
29
|
+
ARG DD_GIT_COMMIT_SHA
|
|
30
|
+
ENV DD_GIT_REPOSITORY_URL=${DD_GIT_REPOSITORY_URL}
|
|
31
|
+
ENV DD_GIT_COMMIT_SHA=${DD_GIT_COMMIT_SHA}
|
|
32
|
+
|
|
33
|
+
COPY --from=builder /usr/src/app/package.json .
|
|
34
|
+
COPY --from=builder /usr/src/app/node_modules node_modules
|
|
35
|
+
COPY dist/apps/${APPNAME}/main.js .
|
|
36
|
+
COPY dist/apps/${APPNAME}/api-documentation ./api-documentation
|
|
37
|
+
|
|
38
|
+
ENTRYPOINT ["/sbin/tini", "--"]
|
package/migrations.json
CHANGED
|
@@ -54,6 +54,11 @@
|
|
|
54
54
|
"version": "5.19.0",
|
|
55
55
|
"description": "Migration for v5.19.0",
|
|
56
56
|
"implementation": "./dist/src/migrations/5.19.0/20260212-docker-tini"
|
|
57
|
+
},
|
|
58
|
+
"20260224-docker-tini-fix": {
|
|
59
|
+
"version": "5.20.0",
|
|
60
|
+
"description": "Migration for v5.20.0",
|
|
61
|
+
"implementation": "./dist/src/migrations/5.20.0/20260224-docker-tini-fix"
|
|
57
62
|
}
|
|
58
63
|
}
|
|
59
64
|
}
|