diff --git a/Dockerfile b/Dockerfile index 4e3a1401..9ac0182e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,14 +10,15 @@ WORKDIR /usr/src/app COPY --chown=node:node package*.json ./ COPY --chown=node:node tsconfig.build.json ./ COPY --chown=node:node tsconfig.json ./ -COPY --chown=node:node nest-cli.json ./ +COPY --chown=node:node nest-cli.fast.json ./ COPY --chown=node:node .env ./ COPY --chown=node:node config ./config COPY --chown=node:node keycloak ./keycloak COPY --chown=node:node src ./src -RUN npm ci -RUN npm run build +ENV NPM_CONFIG_LOGLEVEL=error +RUN npm ci --no-audit +RUN npm run build:fast RUN npm prune --production # Copy and build client project @@ -30,7 +31,7 @@ COPY --chown=node:node client/tsconfig.json ./client/tsconfig.json ENV NODE_OPTIONS=--openssl-legacy-provider ENV CYPRESS_INSTALL_BINARY=0 -RUN npm ci --prefix=client +RUN npm ci --prefix=client --no-audit RUN npm run build --prefix=client USER node @@ -43,7 +44,6 @@ FROM node:18-alpine AS production WORKDIR /usr/src/app -COPY --chown=node:node nest-cli.json ./ COPY --chown=node:node .env ./ COPY --chown=node:node config ./config COPY --chown=node:node keycloak ./keycloak diff --git a/nest-cli.fast.json b/nest-cli.fast.json new file mode 100644 index 00000000..5f3b5763 --- /dev/null +++ b/nest-cli.fast.json @@ -0,0 +1,10 @@ +{ + "$schema": "https://json.schemastore.org/nest-cli#", + "collection": "@nestjs/schematics", + "sourceRoot": "src", + "compilerOptions": { + "deleteOutDir": true, + "builder": "swc", + "typeCheck": false + } +} diff --git a/nest-cli.json b/nest-cli.json index 0a947a58..7c1f74d7 100644 --- a/nest-cli.json +++ b/nest-cli.json @@ -1,7 +1,9 @@ { + "$schema": "https://json.schemastore.org/nest-cli#", "collection": "@nestjs/schematics", "sourceRoot": "src", "compilerOptions": { + "deleteOutDir": true, "builder": "swc", "typeCheck": true } diff --git a/package-lock.json b/package-lock.json index 90811315..6901e9da 100644 --- a/package-lock.json +++ b/package-lock.json @@ -47,7 +47,6 @@ "pg": "^8.12.0", "raw-body": "^3.0.0", "reflect-metadata": "^0.2.2", - "rimraf": "^5.0.10", "rxjs": "^7.8.1", "xmldom": "^0.6.0", "xpath": "0.0.34" @@ -12126,20 +12125,6 @@ "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.3.0.tgz", "integrity": "sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA==" }, - "node_modules/rimraf": { - "version": "5.0.10", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-5.0.10.tgz", - "integrity": "sha512-l0OE8wL34P4nJH/H2ffoaniAokM2qSmrtXHmlpvYr5AVVX8msAyW0l8NVJFDxlSK4u3Uh/f41cQheDVdnYijwQ==", - "dependencies": { - "glob": "^10.3.7" - }, - "bin": { - "rimraf": "dist/esm/bin.mjs" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/run-async": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/run-async/-/run-async-3.0.0.tgz", diff --git a/package.json b/package.json index 3345a565..4f9b4933 100644 --- a/package.json +++ b/package.json @@ -6,8 +6,8 @@ "private": true, "license": "UNLICENSED", "scripts": { - "prebuild": "rimraf dist", "build": "nest build", + "build:fast": "nest build -c nest-cli.fast.json", "format": "prettier --check .", "format:write": "prettier --write .", "start": "nest start", @@ -59,7 +59,6 @@ "pg": "^8.12.0", "raw-body": "^3.0.0", "reflect-metadata": "^0.2.2", - "rimraf": "^5.0.10", "rxjs": "^7.8.1", "xmldom": "^0.6.0", "xpath": "0.0.34"