Skip to content

Commit ef611a1

Browse files
author
Kerkesni
committed
fix ts-config & dockerfile
1 parent 9f2483d commit ef611a1

File tree

4 files changed

+35
-25
lines changed

4 files changed

+35
-25
lines changed

Dockerfile

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,17 @@ RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSI
2828
&& tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
2929
&& rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz
3030

31+
COPY package.json yarn.lock /usr/src/app/
32+
33+
RUN yarn install --ignore-engines --frozen-lockfile --network-concurrency 1
34+
3135
COPY . /usr/src/app
32-
RUN yarn install --ignore-engines --frozen-lockfile --production --network-concurrency 1 \
33-
&& rm -rf /var/lib/apt/lists/* \
34-
&& rm -rf ~/.node-gyp \
35-
&& rm -rf /tmp/yarn-*
36+
3637
RUN yarn build
3738

39+
RUN rm -rf node_modules \
40+
&& yarn install --production --frozen-lockfile --ignore-optional
41+
3842
################################################################################
3943
FROM node:${NODE_VERSION}
4044

@@ -46,7 +50,7 @@ RUN apt-get update && \
4650
WORKDIR /usr/src/app
4751

4852
# Keep the .git directory in order to properly report version
49-
COPY . ./
53+
COPY ./package.json ./docker-entrypoint.sh ./
5054
COPY --from=builder /usr/src/app/dist ./
5155
COPY --from=builder /usr/src/app/node_modules ./node_modules/
5256
COPY --from=builder /usr/local/bin/dockerize /usr/local/bin/

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
},
4747
"homepage": "https://github.com/scality/backbeat#readme",
4848
"dependencies": {
49-
"@types/node": "^18.11.9",
5049
"JSONStream": "^1.3.5",
5150
"arsenal": "git+https://github.com/scality/Arsenal#8.1.76",
5251
"async": "^2.3.0",
@@ -64,7 +63,6 @@
6463
"node-rdkafka": "^2.12.0",
6564
"node-schedule": "^1.2.0",
6665
"node-zookeeper-client": "^1.1.3",
67-
"typescript": "^4.8.4",
6866
"uuid": "^3.1.0",
6967
"vaultclient": "scality/vaultclient#8.3.10",
7068
"werelogs": "scality/werelogs#8.1.2"
@@ -82,7 +80,10 @@
8280
"sinon": "^10.0.0",
8381
"ts-jest": "^29.0.3",
8482
"ts-node": "^10.9.1",
85-
"zookeeper-mock": "^1.2.0"
83+
"zookeeper-mock": "^1.2.0",
84+
"typescript": "^4.8.4",
85+
"@types/node": "^18.11.9",
86+
"@tsconfig/node16": "^1.0.3"
8687
},
8788
"jest": {
8889
"maxWorkers": 1,

tsconfig.json

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
11
{
22
"compilerOptions": {
3-
"target": "es6",
4-
"module": "commonjs",
5-
"rootDir": ".",
6-
"resolveJsonModule": true,
7-
"allowJs": true,
8-
"checkJs": false,
9-
"outDir": "dist",
10-
"esModuleInterop": true,
11-
"forceConsistentCasingInFileNames": true,
12-
"strict": true,
13-
"declaration": true,
14-
"noImplicitAny": false,
15-
"noEmitOnError": false,
16-
"sourceMap": true,
17-
"skipLibCheck": true
3+
/* Visit https://aka.ms/tsconfig to read more about this file */
4+
"incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
5+
"module": "commonjs", /* Specify what module code is generated. */
6+
"rootDir": "./", /* Specify the root folder within your source files. */
7+
"moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */
8+
"declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
9+
"sourceMap": true, /* Create source map files for emitted JavaScript files. */
10+
"outDir": "./dist", /* Specify an output folder for all emitted files. */
11+
"esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
12+
"forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
13+
"strict": true, /* Enable all strict type-checking options. */
14+
"noImplicitAny": false, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
15+
"skipLibCheck": true, /* Skip type checking all .d.ts files. */
16+
"lib": ["es2021"], /* JS APIs and definitions to include */
17+
"target": "es2021", /* Specify JS target revision */
18+
"resolveJsonModule": true, /* Allows importing modules with a .json extension */
19+
"allowJs": true, /* Allow JavaScript files to be imported inside your project */
20+
"checkJs": false, /* Enable error reporting for JavaScript files */
21+
"noEmitOnError": false, /* Do not emit compiler output files like JavaScript source code, source-maps or declarations if any errors were reported. */
1822
},
1923
"include": [
2024
"./bin",
@@ -28,5 +32,6 @@
2832
"exclude": [
2933
"node_modules/*"
3034
],
31-
"compileOnSave": true
35+
"compileOnSave": true,
36+
"extends": "@tsconfig/node16/tsconfig.json"
3237
}

yarn.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -998,7 +998,7 @@
998998
resolved "https://registry.yarnpkg.com/@tsconfig/node14/-/node14-1.0.3.tgz#e4386316284f00b98435bf40f72f75a09dabf6c1"
999999
integrity sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==
10001000

1001-
"@tsconfig/node16@^1.0.2":
1001+
"@tsconfig/node16@^1.0.2", "@tsconfig/node16@^1.0.3":
10021002
version "1.0.3"
10031003
resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.3.tgz#472eaab5f15c1ffdd7f8628bd4c4f753995ec79e"
10041004
integrity sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==

0 commit comments

Comments
 (0)