Skip to content
This repository has been archived by the owner on Jan 21, 2022. It is now read-only.

Commit

Permalink
set default host to 0.0.0.0 for docker instances
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeseese committed Aug 2, 2018
1 parent 8bcdf08 commit 360af41
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ RUN npm install
ADD . .
RUN npm run build

ENV DOCKER true

EXPOSE 8545

ENTRYPOINT ["node", "./build/cli.node.js"]
4 changes: 2 additions & 2 deletions args.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = exports = function(yargs, version) {
module.exports = exports = function(yargs, version, isDocker) {
return yargs
.option('p', {
group: 'Network:',
Expand All @@ -11,7 +11,7 @@ module.exports = exports = function(yargs, version) {
group: 'Network:',
alias: ['host', 'hostname'],
type: 'string',
default: '127.0.0.1',
default: isDocker ? '0.0.0.0' : '127.0.0.1',
describe: 'Hostname to listen on'
})
.option('a', {
Expand Down
3 changes: 2 additions & 1 deletion cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ var BN = require("bn.js");

var detailedVersion = "Ganache CLI v" + pkg.version + " (ganache-core: " + corepkg.version + ")";

var argv = initArgs(yargs, detailedVersion).argv;
var isDocker = "DOCKER" in process.env && process.env.DOCKER.toLowerCase() === "true";
var argv = initArgs(yargs, detailedVersion, isDocker).argv;

function parseAccounts(accounts) {
function splitAccount(account) {
Expand Down

0 comments on commit 360af41

Please sign in to comment.