diff --git a/Dockerfile b/Dockerfile index 32471a5..43194b7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,14 +23,13 @@ RUN npm run build ### Deployment FROM base as deployment -ENV NO_UPDATE_NOTIFIER=true - USER node ARG APP_HOME=/home/node/srv WORKDIR $APP_HOME COPY package.json package.json COPY package-lock.json package-lock.json +RUN npm ci --production COPY --chown=node:node . $APP_HOME COPY --chown=node:node --from=build $APP_HOME/lib $APP_HOME/lib diff --git a/package.json b/package.json index f6dd65f..236a2e2 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "scripts": { "build": "npm-run-all build:clean build:tsc", "build:clean": "rimraf lib", - "build:tsc": "esbuild ./src/start.ts --bundle --platform=node --outfile=lib/start.cjs --minify --tree-shaking=true --sourcemap=inline", + "build:tsc": "esbuild ./src/start.ts --bundle --platform=node --outfile=lib/start.cjs --minify --tree-shaking=true --sourcemap=inline --packages=external", "dev": "cross-env NODE_ENV=development nodemon --watch './src/**/*.ts' --exec node --loader ts-node/esm ./src/start.ts", "start": "node lib/start.cjs", "test": "vitest",