From 448017dbbd70d067c593b1871956d2a3cc78db71 Mon Sep 17 00:00:00 2001 From: Win Date: Thu, 12 Sep 2024 10:59:13 +0700 Subject: [PATCH 1/3] MOL-431: update dockerfile + packages --- processor/Dockerfile | 2 +- processor/package.json | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/processor/Dockerfile b/processor/Dockerfile index 76c1d8f..2a9a82c 100644 --- a/processor/Dockerfile +++ b/processor/Dockerfile @@ -4,7 +4,7 @@ WORKDIR /app COPY ./package*.json ./ -RUN npm install --production --frozen-lockfile +RUN npm install -g typescript && npm install --production --frozen-lockfile COPY . . diff --git a/processor/package.json b/processor/package.json index 7a8e33f..5afaa22 100644 --- a/processor/package.json +++ b/processor/package.json @@ -8,7 +8,7 @@ "start": "node dist/index.js", "gcp-build": "tsc", "start:dev": "concurrently -k \"tsc --watch\" \"nodemon -q dist/index.js\"", - "build": "rimraf ./dist && tsc", + "build": "rm -rf ./dist && tsc", "watch": "nodemon -q --ignore '**/*.spec.ts' src/index.ts", "lint": "eslint . --ext .ts", "prettier:check": "prettier --check '**/*.{js,ts}'", @@ -34,11 +34,7 @@ }, "devDependencies": { "@tsconfig/recommended": "^1.0.7", - "@types/express": "^4.17.21", - "@types/jest": "^29.5.12", "@types/node": "^18.19.39", - "@types/node-fetch": "^2.6.11", - "@types/validator": "^13.12.0", "@typescript-eslint/eslint-plugin": "7.13.1", "@typescript-eslint/parser": "7.13.1", "concurrently": "^8.2.2", @@ -60,6 +56,10 @@ "typescript": "^5.5.3" }, "dependencies": { + "@types/express": "^4.17.21", + "@types/jest": "^29.5.12", + "@types/node-fetch": "^2.6.11", + "@types/validator": "^13.12.0", "@commercetools-backend/loggers": "^21.25.2", "@commercetools/platform-sdk": "^4.11.0", "@commercetools/sdk-client-v2": "^2.5.0", From c324f46ee50fe6a637d2865b475c4c563afa40de Mon Sep 17 00:00:00 2001 From: Win Date: Thu, 12 Sep 2024 11:55:00 +0700 Subject: [PATCH 2/3] MOL-431: update dockerfile + packages --- processor/Dockerfile | 4 ++-- processor/package.json | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/processor/Dockerfile b/processor/Dockerfile index 2a9a82c..5a0f3bb 100644 --- a/processor/Dockerfile +++ b/processor/Dockerfile @@ -4,11 +4,11 @@ WORKDIR /app COPY ./package*.json ./ -RUN npm install -g typescript && npm install --production --frozen-lockfile +RUN npm install --frozen-lockfile COPY . . -RUN npm run build +RUN npm run build && npm prune --production FROM node:18-alpine AS runner diff --git a/processor/package.json b/processor/package.json index 5afaa22..2ba675b 100644 --- a/processor/package.json +++ b/processor/package.json @@ -8,7 +8,7 @@ "start": "node dist/index.js", "gcp-build": "tsc", "start:dev": "concurrently -k \"tsc --watch\" \"nodemon -q dist/index.js\"", - "build": "rm -rf ./dist && tsc", + "build": "rimraf ./dist && tsc", "watch": "nodemon -q --ignore '**/*.spec.ts' src/index.ts", "lint": "eslint . --ext .ts", "prettier:check": "prettier --check '**/*.{js,ts}'", @@ -33,6 +33,10 @@ "node": ">=18.0.0 <=20.9.0" }, "devDependencies": { + "@types/express": "^4.17.21", + "@types/jest": "^29.5.12", + "@types/node-fetch": "^2.6.11", + "@types/validator": "^13.12.0", "@tsconfig/recommended": "^1.0.7", "@types/node": "^18.19.39", "@typescript-eslint/eslint-plugin": "7.13.1", @@ -56,10 +60,6 @@ "typescript": "^5.5.3" }, "dependencies": { - "@types/express": "^4.17.21", - "@types/jest": "^29.5.12", - "@types/node-fetch": "^2.6.11", - "@types/validator": "^13.12.0", "@commercetools-backend/loggers": "^21.25.2", "@commercetools/platform-sdk": "^4.11.0", "@commercetools/sdk-client-v2": "^2.5.0", From 325afdf5d851f16f60c9cce7a684f26362b09faa Mon Sep 17 00:00:00 2001 From: Tung Huynh <84435886+Tung-Huynh-Shopmacher@users.noreply.github.com> Date: Thu, 12 Sep 2024 12:41:56 +0700 Subject: [PATCH 3/3] Update Dockerfile --- processor/Dockerfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/processor/Dockerfile b/processor/Dockerfile index 5a0f3bb..1d010e2 100644 --- a/processor/Dockerfile +++ b/processor/Dockerfile @@ -8,7 +8,9 @@ RUN npm install --frozen-lockfile COPY . . -RUN npm run build && npm prune --production +RUN npm run build + +RUN npm prune --production FROM node:18-alpine AS runner @@ -27,4 +29,4 @@ CMD ["npm", "run", "start"] # Metadata LABEL org.opencontainers.image.authors="Mollie B.V. " \ - copyright="Copyright (c) 2024 Mollie B.V. All rights reserved." \ No newline at end of file + copyright="Copyright (c) 2024 Mollie B.V. All rights reserved."