Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Git and version control
.git
.gitignore

# Docker specific
Dockerfile

# Node.js dependencies
node_modules/
npm-debug.log*
yarn-error.log

# Build output
dist/
build/

# Environment variables
.env*

# OS specific
.DS_Store
Thumbs.db

# IDE specific
.vscode/
.idea/
*.swp
*.swo
3 changes: 2 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2018,
ecmaVersion: 2022,
sourceType: 'module',
project: './tsconfig.json'
},
Expand All @@ -15,6 +15,7 @@ module.exports = {
},
extends: [
'standard',
'plugin:@typescript-eslint/recommended',
],
rules: {
'no-unused-vars': 'off',
Expand Down
12 changes: 7 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:8 as build
FROM node:18-alpine as build

WORKDIR /opt

Expand All @@ -9,20 +9,22 @@ COPY internal internal
COPY src src
COPY type type

RUN npm run install:dev
COPY package-lock.json .
RUN npm install --legacy-peer-deps
RUN npm run build

FROM node:8
FROM node:18-alpine

WORKDIR /opt

COPY --from=build /opt/package.json package.json
COPY package-lock.json .

Copilot AI May 22, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the final stage you copy package-lock.json from the build context instead of the build stage. You may want to COPY --from=build /opt/package-lock.json . to ensure the exact lockfile used during build is applied in the runtime image.

Suggested change
COPY package-lock.json .
COPY --from=build /opt/package-lock.json .

Copilot uses AI. Check for mistakes.
COPY --from=build /opt/config config
COPY --from=build /opt/dist dist

RUN npm run install:prod
RUN npm ci --only=production --legacy-peer-deps

ENV PATH=/opt/node_modules/.bin:$PATH
USER node

CMD ["npm"]
CMD ["node", "dist/index.js"]
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"description": "starting point of a new api",
"private": true,
"engines": {
"node": "^10.0.0",
"npm": "^6.4.0"
"node": "^18.17.0",
"npm": "^9.6.7"
},
"types": "type/index.d.ts",
"scripts": {
Expand Down Expand Up @@ -35,26 +35,26 @@
"@types/cors": "2.8.4",
"@types/express": "4.11.1",
"@types/helmet": "0.0.37",
"@types/jest": "^23.3.9",
"@types/jest": "^29.5.5",
"@types/lodash": "4.14.109",
"@types/node": "8.9.4",
"@typescript-eslint/eslint-plugin": "^1.4.2",
"@typescript-eslint/parser": "^1.4.2",
"eslint": "^5.15.2",
"@types/node": "^18.17.0",
"@typescript-eslint/eslint-plugin": "^6.7.3",
"@typescript-eslint/parser": "^6.7.3",
"eslint": "^8.50.0",
"eslint-config-standard": "^12.0.0",
"eslint-plugin-import": "^2.16.0",
"eslint-plugin-node": "^8.0.1",
"eslint-plugin-promise": "^4.0.1",
"eslint-plugin-standard": "^4.0.0",
"jest": "^23.6.0",
"jest": "^29.7.0",
"jest-config": "23.6.0",
"nodemon": "1.17.4",
"ts-jest": "^23.10.4",
"ts-jest": "^29.1.1",
"ts-node": "6.0.3",
"typescript": "3.3.3333"
"typescript": "^5.2.2"
},
"optionalDependencies": {
Comment on lines +54 to 56

Copilot AI May 22, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Husky is configured under optionalDependencies, but it’s a development tool and should typically be in devDependencies to avoid shipping unnecessary packages to production.

Suggested change
"typescript": "^5.2.2"
},
"optionalDependencies": {
"typescript": "^5.2.2",

Copilot uses AI. Check for mistakes.
"husky": "next"
"husky": "^8.0.0"
},
"husky": {
"hooks": {
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"target": "es2018",
"target": "es2022",
"module": "commonjs",
"moduleResolution": "node",
"outDir": "dist",
Expand All @@ -9,7 +9,7 @@
"esModuleInterop": true,
"strict": true,
"lib": [
"es2018"
"es2022"
]
},
"include": [
Expand Down