File tree 6 files changed +55
-4
lines changed
6 files changed +55
-4
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,8 @@ MONGODB_URI=mongodb://mongo:27017/appy
5
5
SERVER_HOST=localhost
6
6
SERVER_PORT=8080
7
7
CLIENT_URI=http://localhost:3000
8
+ SERVER_HOST=localhost
9
+ SERVER_PORT=8080
8
10
FACEBOOK_ID=1234
9
11
FACEBOOK_SECRET=abcd
10
12
FACEBOOK_ACCESS_TOKEN=5678
Original file line number Diff line number Diff line change @@ -11,8 +11,9 @@ COPY ./package.json /backend
11
11
# Install node dependencies
12
12
RUN npm install
13
13
14
- # Make port 8080 available to the world outside this container
15
- EXPOSE 8080
14
+ ARG SERVER_PORT=8080
15
+ # Make the server port available to the world outside this container
16
+ EXPOSE ${SERVER_PORT}
16
17
17
18
# Run the start script when the container launches
18
19
CMD ["npm" , "run" , "start" ]
Original file line number Diff line number Diff line change @@ -71,8 +71,8 @@ const config = {
71
71
projectName : constants . API_TITLE ,
72
72
port : {
73
73
$filter : 'env' ,
74
- production : 8080 ,
75
- $default : 8080
74
+ production : process . env . SERVER_PORT ,
75
+ $default : process . env . SERVER_PORT
76
76
} ,
77
77
S3BucketName : {
78
78
$filter : 'env' ,
@@ -212,6 +212,11 @@ const config = {
212
212
apiPath : path . join ( __dirname , '/../server/api' ) ,
213
213
absolutePolicyPath : true ,
214
214
policyPath : path . join ( __dirname , '/../server/policies' ) ,
215
+ swaggerHost : {
216
+ $filter : 'env' ,
217
+ production : process . env . SERVER_HOST ,
218
+ $default : `${ process . env . SERVER_HOST } :${ process . env . SERVER_PORT } `
219
+ } ,
215
220
authStrategy : {
216
221
$filter : 'env' ,
217
222
production : constants . AUTH_STRATEGIES . REFRESH ,
Original file line number Diff line number Diff line change
1
+ version : " 3.4"
2
+
3
+ volumes :
4
+ mongo_data :
5
+ name : appy_mongo_data
6
+
7
+ networks :
8
+ backend :
9
+
10
+ services :
11
+
12
+ mongo :
13
+ image : mongo:3.6.4
14
+ ports :
15
+ - 27018:27017
16
+ volumes :
17
+ - " mongo_data:/data/db"
18
+ networks :
19
+ - backend
20
+ restart : always
21
+
22
+ api :
23
+ build : ./
24
+ ports :
25
+ - " ${SERVER_PORT}:${SERVER_PORT}"
26
+ volumes :
27
+ # Share the entire project except "node_modules". This prevents us from having to COPY the project files
28
+ # in the Dockerfile, while still keeping separate node dependency files.
29
+ - " ./:/backend"
30
+ - " /backend/node_modules"
31
+ networks :
32
+ - backend
33
+ depends_on :
34
+ - mongo
35
+ env_file :
36
+ - ./.env-docker
Original file line number Diff line number Diff line change 60
60
},
61
61
"devDependencies" : {
62
62
"babel-eslint" : " ^8.2.3" ,
63
+ "commander" : " ^2.20.0" ,
63
64
"eslint" : " ^4.19.1" ,
64
65
"eslint-config-prettier" : " ^2.9.0" ,
65
66
"eslint-config-prettier-standard" : " ^2.0.0" ,
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ source .env-docker
4
+ export SERVER_PORT=${SERVER_PORT}
5
+ export COMPOSE_PROJECT_NAME=appy_backend
6
+ docker-compose up --build
You can’t perform that action at this time.
0 commit comments