Skip to content

Commit

Permalink
fix ts-config & dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
Kerkesni committed Feb 14, 2023
1 parent 9f2483d commit ef611a1
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 25 deletions.
14 changes: 9 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,17 @@ RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSI
&& tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
&& rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz

COPY package.json yarn.lock /usr/src/app/

RUN yarn install --ignore-engines --frozen-lockfile --network-concurrency 1

COPY . /usr/src/app
RUN yarn install --ignore-engines --frozen-lockfile --production --network-concurrency 1 \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf ~/.node-gyp \
&& rm -rf /tmp/yarn-*

RUN yarn build

RUN rm -rf node_modules \
&& yarn install --production --frozen-lockfile --ignore-optional

################################################################################
FROM node:${NODE_VERSION}

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

# Keep the .git directory in order to properly report version
COPY . ./
COPY ./package.json ./docker-entrypoint.sh ./
COPY --from=builder /usr/src/app/dist ./
COPY --from=builder /usr/src/app/node_modules ./node_modules/
COPY --from=builder /usr/local/bin/dockerize /usr/local/bin/
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
},
"homepage": "https://github.com/scality/backbeat#readme",
"dependencies": {
"@types/node": "^18.11.9",
"JSONStream": "^1.3.5",
"arsenal": "git+https://github.com/scality/Arsenal#8.1.76",
"async": "^2.3.0",
Expand All @@ -64,7 +63,6 @@
"node-rdkafka": "^2.12.0",
"node-schedule": "^1.2.0",
"node-zookeeper-client": "^1.1.3",
"typescript": "^4.8.4",
"uuid": "^3.1.0",
"vaultclient": "scality/vaultclient#8.3.10",
"werelogs": "scality/werelogs#8.1.2"
Expand All @@ -82,7 +80,10 @@
"sinon": "^10.0.0",
"ts-jest": "^29.0.3",
"ts-node": "^10.9.1",
"zookeeper-mock": "^1.2.0"
"zookeeper-mock": "^1.2.0",
"typescript": "^4.8.4",
"@types/node": "^18.11.9",
"@tsconfig/node16": "^1.0.3"
},
"jest": {
"maxWorkers": 1,
Expand Down
37 changes: 21 additions & 16 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"rootDir": ".",
"resolveJsonModule": true,
"allowJs": true,
"checkJs": false,
"outDir": "dist",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"declaration": true,
"noImplicitAny": false,
"noEmitOnError": false,
"sourceMap": true,
"skipLibCheck": true
/* Visit https://aka.ms/tsconfig to read more about this file */
"incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
"module": "commonjs", /* Specify what module code is generated. */
"rootDir": "./", /* Specify the root folder within your source files. */
"moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */
"declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
"sourceMap": true, /* Create source map files for emitted JavaScript files. */
"outDir": "./dist", /* Specify an output folder for all emitted files. */
"esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
"forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
"strict": true, /* Enable all strict type-checking options. */
"noImplicitAny": false, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
"skipLibCheck": true, /* Skip type checking all .d.ts files. */
"lib": ["es2021"], /* JS APIs and definitions to include */
"target": "es2021", /* Specify JS target revision */
"resolveJsonModule": true, /* Allows importing modules with a .json extension */
"allowJs": true, /* Allow JavaScript files to be imported inside your project */
"checkJs": false, /* Enable error reporting for JavaScript files */
"noEmitOnError": false, /* Do not emit compiler output files like JavaScript source code, source-maps or declarations if any errors were reported. */
},
"include": [
"./bin",
Expand All @@ -28,5 +32,6 @@
"exclude": [
"node_modules/*"
],
"compileOnSave": true
"compileOnSave": true,
"extends": "@tsconfig/node16/tsconfig.json"
}
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -998,7 +998,7 @@
resolved "https://registry.yarnpkg.com/@tsconfig/node14/-/node14-1.0.3.tgz#e4386316284f00b98435bf40f72f75a09dabf6c1"
integrity sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==

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

0 comments on commit ef611a1

Please sign in to comment.