File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,13 +2,11 @@ FROM node:14.15.1-alpine3.12
22
33WORKDIR /app
44
5- COPY package*.json ./
5+ COPY . .
66
77RUN yarn install --production
88
9- COPY . .
10-
11- RUN yarn tsc
9+ RUN yarn postinstall
1210
1311EXPOSE 8080
1412
Original file line number Diff line number Diff line change @@ -19,5 +19,6 @@ services:
1919 POSTGRES_USER : admin
2020 POSTGRES_PASSWORD : admin
2121 POSTGRES_DB : video
22+ PROD : 0
2223 ports :
2324 - " 8080:8080"
Original file line number Diff line number Diff line change @@ -5,6 +5,8 @@ const pgp = require('pg-promise')();
55const cors = require ( 'cors' ) ;
66const bodyParser = require ( 'body-parser' ) ;
77
8+ const port = process . env . PORT || 8080 ;
9+
810const PG_USERNAME = process . env . POSTGRES_USER ;
911const PG_PASSWORD = process . env . POSTGRES_PASSWORD ;
1012const PG_DB = process . env . POSTGRES_DB ;
@@ -116,8 +118,8 @@ app.route('/author/:id')
116118 res . send ( data . name )
117119 } )
118120 . catch ( ( ) => res . status ( 401 ) . send ) ;
119- } )
121+ } ) ;
120122
121- server . listen ( 8080 , ( ) => {
122- console . log ( ' App is listening on port 8080' ) ;
123+ server . listen ( port , ( ) => {
124+ console . log ( ` App is listening on port ${ port } ` ) ;
123125} ) ;
You can’t perform that action at this time.
0 commit comments