docker-github-pages
docker-github-pages copied to clipboard
Host configuration and access
Hi,
$ docker run --rm -v $PWD:/usr/src/app -p 4000:4000 starefossen/github-pages:latest jekyll serve --config _config.yml,_config_local.yml
_config_local.yml
contains
host: 0.0.0.0
port: 4000
Output:
Configuration file: _config.yml
Configuration file: _config_local.yml
Source: /usr/src/app
Destination: /usr/src/app/_site
Incremental build: disabled. Enable with --incremental
Generating...
done in 0.808 seconds.
Auto-regeneration: enabled for '/usr/src/app'
Configuration file: /usr/src/app/_config.yml
Server address: http://127.0.0.1:4000/
Server running... press ctrl-c to stop.
Result: generated site is inaccessible from the host via localhost:4000
.
Workaround is to add --host 0.0.0.0
to the command line:
$ docker run --rm -v $PWD:/usr/src/app -p 4000:4000 starefossen/github-pages:latest jekyll serve --config _config.yml,_config_local.yml --host 0.0.0.0
Configuration file: _config.yml
Configuration file: _config_local.yml
Source: /usr/src/app
Destination: /usr/src/app/_site
Incremental build: disabled. Enable with --incremental
Generating...
done in 0.813 seconds.
Auto-regeneration: enabled for '/usr/src/app'
Configuration file: /usr/src/app/_config.yml
Server address: http://0.0.0.0:4000/
Server running... press ctrl-c to stop.
Kind regards, Alexis.
Good catch @AlexisBRENON. We should probably add a note about this to the README. Would you like to make a Pull Request?
For sure, I can make a PR if necessary, but is there an elegant way to fix this without adding the --host
option manually? An option in docker to translate requester IP or something like this...
it seems that this issue should be closed now