diff --git a/docker/Dockerfile.prod b/docker/Dockerfile.prod index 2774a82..995e1d1 100644 --- a/docker/Dockerfile.prod +++ b/docker/Dockerfile.prod @@ -1,10 +1,17 @@ # Stage 1 - build FROM node:16.14.0-alpine3.15 as build +## Install build toolchain, install node deps and compile native add-ons +RUN apk add --no-cache python3 make g++ + WORKDIR /usr/src/app COPY package.json yarn.lock ./ +RUN yarn install --production + +RUN cp -R node_modules prod_node_modules + RUN yarn install COPY . . @@ -19,9 +26,7 @@ FROM node:16.14.0-alpine3.15 WORKDIR /usr/src/app COPY package.json yarn.lock ./ - -RUN yarn install --production - +COPY --from=build /usr/src/app/prod_node_modules ./node_modules COPY --from=build /usr/src/app/dist ./dist COPY --from=build /usr/src/app/public ./public diff --git a/tsconfig.json b/tsconfig.json index 68155e3..c92b512 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,7 +4,7 @@ /* Basic Options */ // "incremental": true, /* Enable incremental compilation */ - "target": "ES2015", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', 'ES2021', or 'ESNEXT'. */ + "target": "ES2015", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', 'ES2021', or 'ESNEXT'. */ "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */ // "lib": [], /* Specify library files to be included in the compilation. */ // "allowJs": true, /* Allow javascript files to be compiled. */ @@ -14,7 +14,7 @@ // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ // "sourceMap": true, /* Generates corresponding '.map' file. */ // "outFile": "./", /* Concatenate and emit output to single file. */ - "outDir": "./dist/", /* Redirect output structure to the directory. */ + "outDir": "./dist/", /* Redirect output structure to the directory. */ // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ // "composite": true, /* Enable project compilation */ // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */ @@ -68,5 +68,6 @@ /* Advanced Options */ "skipLibCheck": true, /* Skip type checking of declaration files. */ "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */ - } + }, + "include": ["src/**/*"] }