Starefossen / docker-github-pages

:octocat: :whale: Alpine Docker Image for GitHub Pages and Jekyll powered sites
https://registry.hub.docker.com/u/starefossen/github-pages/
MIT License
192 stars 54 forks source link

Host configuration and access #3

Open AlexisBRENON opened 8 years ago

AlexisBRENON commented 8 years ago

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.

See configuration files

Kind regards, Alexis.

Starefossen commented 8 years ago

Good catch @AlexisBRENON. We should probably add a note about this to the README. Would you like to make a Pull Request?

AlexisBRENON commented 8 years ago

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...

Oliboy50 commented 2 years ago

it seems that this issue should be closed now