File tree Expand file tree Collapse file tree 5 files changed +77
-23
lines changed Expand file tree Collapse file tree 5 files changed +77
-23
lines changed Original file line number Diff line number Diff line change
1
+ FROM node:10-slim
2
+
3
+ RUN apt-get update \
4
+ && mkdir -p /usr/share/man/man1 \
5
+ && mkdir -p /usr/share/man/man7 \
6
+ && apt-get install -y --no-install-recommends postgresql-client libpq-dev \
7
+ && rm -rf /var/lib/apt/lists/* \
8
+ && apt-get clean
9
+
10
+ WORKDIR /usr/src/app
11
+
12
+ COPY package* ./
13
+
14
+ RUN npm install -g
15
+
16
+ COPY . ./
17
+
18
+ CMD npm start
Original file line number Diff line number Diff line change 7
7
var app = require ( '../app' ) ;
8
8
var debug = require ( 'debug' ) ( 'node-sequelize:server' ) ;
9
9
var http = require ( 'http' ) ;
10
+ var models = require ( '../models' ) ;
11
+
12
+ /**
13
+ * Sync Database
14
+ */
15
+
16
+ models . sequelize . sync ( )
10
17
11
18
/**
12
19
* Get port from environment and store in Express.
Original file line number Diff line number Diff line change
1
+ const creds = {
2
+ development : {
3
+ username : process . env . DB_USERNAME ,
4
+ password : process . env . DB_PASSWORD ,
5
+ database : process . env . DB_NAME ,
6
+ host : process . env . DB_HOSTNAME ,
7
+ dialect : 'postgresql'
8
+ } ,
9
+ test : {
10
+ username : process . env . DB_USERNAME ,
11
+ password : process . env . DB_PASSWORD ,
12
+ database : process . env . DB_NAME ,
13
+ host : process . env . DB_HOSTNAME ,
14
+ dialect : 'postgresql'
15
+ } ,
16
+ production : {
17
+ username : process . env . DB_USERNAME ,
18
+ password : process . env . DB_PASSWORD ,
19
+ database : process . env . DB_NAME ,
20
+ host : process . env . DB_HOSTNAME ,
21
+ dialect : 'postgresql'
22
+ }
23
+ } ;
24
+
25
+ module . exports = creds ;
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ version : ' 2.1'
2
+
3
+ services :
4
+ api :
5
+ build : .
6
+ environment :
7
+ DB_USERNAME : postgres
8
+ DB_PASSWORD : test
9
+ DB_NAME : test
10
+ DB_HOSTNAME : db
11
+ ports :
12
+ - 3000:3000
13
+ depends_on :
14
+ db :
15
+ condition : service_healthy
16
+ db :
17
+ image : postgres:10
18
+ restart : always
19
+ environment :
20
+ POSTGRES_PASSWORD : test
21
+ POSTGRES_DB : test
22
+ ALLOW_IP_RANGE : 0.0.0.0/0
23
+ healthcheck :
24
+ test : ["CMD-SHELL", "pg_isready -U postgres"]
25
+ interval : 10s
26
+ timeout : 5s
27
+ retries : 5
You can’t perform that action at this time.
0 commit comments