File tree Expand file tree Collapse file tree 2 files changed +17
-17
lines changed Expand file tree Collapse file tree 2 files changed +17
-17
lines changed Original file line number Diff line number Diff line change 1- FROM node:8
1+ # syntax=docker/dockerfile:1
22
3- WORKDIR /usr/src/app
3+ FROM node:12.18.1
4+ ENV NODE_ENV=production
45
5- COPY package*.json ./
6- RUN npm ci --only=production
6+ WORKDIR /app
7+
8+ COPY ["package.json" , "package-lock.json*" , "./" ]
9+
10+ RUN npm install --production
711
812COPY . .
913
10- EXPOSE 8080
11- CMD [ "npm" , "start" ]
14+ CMD [ "node" , "server.js" ]
Original file line number Diff line number Diff line change 1- 'use strict' ;
1+ const express = require ( 'express' )
2+ const app = express ( )
3+ const port = 3000
24
3- const express = require ( 'express' ) ;
4-
5- const PORT = 8080 ;
6- const HOST = '0.0.0.0' ;
7-
8- const app = express ( ) ;
95app . get ( '/' , ( req , res ) => {
10- res . send ( 'Hello world\n' ) ;
11- } ) ;
6+ res . send ( 'Hello World!' )
7+ } )
128
13- app . listen ( PORT , HOST ) ;
14- console . log ( `Running on http://${ HOST } :${ PORT } ` ) ;
9+ app . listen ( port , ( ) => {
10+ console . log ( `Example app listening on port ${ port } ` )
11+ } )
You can’t perform that action at this time.
0 commit comments