2

I'm having a hard time running a container from the Ghost image in development (after docker pull ghost).

Using:

docker run --name some-ghost -p 4000:2368 -v /Users/Documents/ghost-blog/content/themes/:/var/lib/ghost/content/themes/ -e NODE_ENV=development ghost

seems to start the container in development but when I navigate to the page in browser I get

localhost didn’t send any data. ERR_EMPTY_RESPONSE

I've tried looking this up but it seems like development was previously the default environment until recently. I'm not really sure where to proceed.

Mr.Richway
  • 141
  • 2
  • 15
  • Are you using `docker-machine`? Are you using the right port in the URL (4000)? – Ayman Nedjmeddine Aug 07 '17 at 19:49
  • I'm not. I'm fairly new to docker, I'm not sure what `docker-machine` is. Yes I'm using the correct port. When I switch to production the URL works as intended. – Mr.Richway Aug 07 '17 at 19:51
  • Try visiting `http://localhost:4000`. – Ayman Nedjmeddine Aug 07 '17 at 19:53
  • Doesn't work in dev, getting the error above. It works in production though. – Mr.Richway Aug 07 '17 at 19:54
  • I tried running that, it works normally with production env as you said, but it returns a `HTTP 500 Internal Server Error` with development env. But that is an error with Ghost. However it sends back a response. Running the container, does it echo an error? – Ayman Nedjmeddine Aug 07 '17 at 20:15
  • There's no error in the container, I get `Ghost is running in development`. I'm not getting a server error either it's `324`. – Mr.Richway Aug 07 '17 at 20:21
  • I am seeing the same issue. Works in production mode, but not in development. Have you found a solution yet? – vekerdyb Sep 04 '17 at 12:51

1 Answers1

0

According to acburdine's answer, you need to specify further environment variables:

docker run --name some-ghost -p 4000:2368 -v /Users/Documents/ghost-blog/content/themes/:/var/lib/ghost/content/themes/ -e NODE_ENV=development -e server__host=0.0.0.0 -e url="http://localhost:2368" ghost

vekerdyb
  • 1,213
  • 12
  • 26