File tree Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -3,17 +3,15 @@ FROM node:20-alpine
33# Create app directory
44WORKDIR /usr/src/app
55
6- # Install app dependencies
6+ # Bundle app source
7+ COPY tsconfig.json ./
78COPY package*.json ./
8- RUN npm install --silent && npm cache clean --force --silent
9+ COPY src ./src
910
10- # Bundle app source
11- COPY . .
11+ RUN npm install && npm cache clean --force --silent
1212RUN npm run build
1313
14- # Remove source files
15- RUN rm -rf src
1614RUN npm prune --production
1715
1816EXPOSE 8080
19- CMD [ "node " , "dist/server.js" ]
17+ CMD ["npm " , "start" ]
Original file line number Diff line number Diff line change 55 "main" : " index.js" ,
66 "scripts" : {
77 "test" : " echo \" Error: no test specified\" && exit 1" ,
8+ "start" : " node dist/index.mjs" ,
89 "build" : " tsc"
910 },
1011 "repository" : {
You can’t perform that action at this time.
0 commit comments