Skip to content
This repository was archived by the owner on Jul 9, 2019. It is now read-only.

Commit d61c7be

Browse files
committed
Re-introduce EXPOSE directives to Dockerfile.
1 parent d4357ec commit d61c7be

File tree

4 files changed

+18
-14
lines changed

4 files changed

+18
-14
lines changed

Dockerfile

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
FROM ubuntu
22
33

4-
# ENV WEB_API_URL https://enigmatic-meadow-89512.herokuapp.com
4+
EXPOSE 1883
5+
EXPOSE 8883
6+
EXPOSE 80
7+
EXPOSE 443
8+
EXPOSE 3002
9+
510
RUN apt-get update
611
RUN apt-get install -y curl
712

app/config.js

+9-11
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
1+
var log = require("./logger");
2+
13
// TODO: Clean up ENV management into something less crappy.
24
// or use a 3rd party node ENV manager module.
5+
var DEFAULT_URL = "http://localhost:3000";
36

47
var webAppUrl;
5-
var log = require("./logger");
6-
78
if (process.env.WEB_API_URL) {
8-
webAppUrl = process.env.WEB_API_URL;
9+
webAppUrl = process.env.WEB_API_URL;
910
} else {
10-
missing("WEB_API_URL");
11+
webAppUrl = DEFAULT_URL;
12+
log("You did not set WEB_API_URL. Defaulting to " + DEFAULT_URL);
1113
}
1214

1315
module.exports = {
14-
webAppUrl: webAppUrl,
15-
httpPort: 3002,
16-
mqttPort: 1883
17-
}
18-
19-
function missing(varName) {
20-
log("You did not set the `" + varName + "` ENV var.");
16+
webAppUrl: webAppUrl,
17+
httpPort: 3002,
18+
mqttPort: 1883
2119
}

app/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ var input = {
1111
static: "./public"
1212
}
1313
};
14+
1415
maybeEnableSSL(input)
1516
var server = new Server(input);
1617

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"main": "app/index.js",
66
"scripts": {
77
"start": "node app/index.js",
8-
"test": "WEB_API_URL=http://localhost:3000 node_modules/.bin/istanbul cover node_modules/.bin/jasmine",
8+
"test": "node_modules/.bin/istanbul cover node_modules/.bin/jasmine",
99
"dev": "WEB_API_URL=http://localhost:3000 node app/index.js"
1010
},
1111
"repository": {
@@ -28,4 +28,4 @@
2828
"istanbul": "^0.4.4",
2929
"jasmine": "^2.4.1"
3030
}
31-
}
31+
}

0 commit comments

Comments
 (0)