mmornati / docker-ghostblog

Ghost Blog Docker Container
MIT License
10 stars 6 forks source link

running on local mac #4

Closed pascalandy closed 7 years ago

pascalandy commented 7 years ago

Hi,

I'm running this a on my mac:

docker run -d --name ghostuat \
-p 2368:2368 \
-e WEB_URL=http://localhost:2368 -e SERVER_PORT=2368 \
mmornati/docker-ghostblog

but there is no service on http://localhost:2368/

Any suggestion?

mmornati commented 7 years ago

Can you try to run it without the -d to have log information about what is happening. In this I think we will have the information about the problem. You can paste the log here... I'm using it on Mac too and it is working for me... so it is maybe a missing configuration.

pascalandy commented 7 years ago

There we go

➜  ~ docker run --name ghostuat \
> -p 2368:2368 \
> -e WEB_URL=http://localhost:2368 -e SERVER_PORT=2368 \
> mmornati/docker-ghostblog
DB_CLIENT is empty. Getting default: sqlite3
DB_SQLITE_PATH is empty. Getting default: /ghost-override/content/data/ghost-local.db
SERVER_HOST is empty. Getting default: 0.0.0.0
=> Change config based on ENV parameters:
========================================================================
      WEB_URL:        http://localhost:2368
      DB_CLIENT:      sqlite3
      DB_SQLITE_PATH: /ghost-override/content/data/ghost-local.db
      SERVER_HOST:    0.0.0.0
      SERVER_PORT:    2368
========================================================================
/ghost/blog/versions/1.13.0/core/server/config/utils.js:77
        throw new Error('Your content path does not exist! Please double check `paths.contentPath` in your custom config file e.g. config.production.json.');
        ^

Error: Your content path does not exist! Please double check `paths.contentPath` in your custom config file e.g. config.production.json.
    at doesContentPathExist (/ghost/blog/versions/1.13.0/core/server/config/utils.js:77:15)
    at Object.loadNconf (/ghost/blog/versions/1.13.0/core/server/config/index.js:61:11)
    at Object.<anonymous> (/ghost/blog/versions/1.13.0/core/server/config/index.js:78:27)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
➜  ~
mmornati commented 7 years ago

Ah yeah. It is my fault (but I don't know how we can fix it yet).

The configuration provided inside the container is looking for content information inside /ghost-override/content/data/ghost-local.db and it seems this folder is not inside the container. I'm actually mounting it to a local folder where I've my full content.

In the config.production.json there is this line: "contentPath": "/ghost-override/content" and I think inside the container the /ghost-override folder is empty.

I can maybe create an empty content folder at the first startup if does not exist.

mmornati commented 7 years ago

It is fixed in my last commit. Let me know if it is working for you now.

pascalandy commented 7 years ago

Same story:

➜  css git:(master) ✗ docker run --name ghostuat \
> -p 2368:2368 \
> -e WEB_URL=http://localhost:2368 -e SERVER_PORT=2368 \
> mmornati/docker-ghostblog:1.14.0; echo;
DB_CLIENT is empty. Getting default: sqlite3
DB_SQLITE_PATH is empty. Getting default: /ghost-override/content/data/ghost-local.db
SERVER_HOST is empty. Getting default: 0.0.0.0
=> Change config based on ENV parameters:
========================================================================
      WEB_URL:        http://localhost:2368
      DB_CLIENT:      sqlite3
      DB_SQLITE_PATH: /ghost-override/content/data/ghost-local.db
      SERVER_HOST:    0.0.0.0
      SERVER_PORT:    2368
========================================================================
/ghost/blog/versions/1.14.0/core/server/config/utils.js:77
        throw new Error('Your content path does not exist! Please double check `paths.contentPath` in your custom config file e.g. config.production.json.');
        ^

Error: Your content path does not exist! Please double check `paths.contentPath` in your custom config file e.g. config.production.json.
    at doesContentPathExist (/ghost/blog/versions/1.14.0/core/server/config/utils.js:77:15)
    at Object.loadNconf (/ghost/blog/versions/1.14.0/core/server/config/index.js:61:11)
    at Object.<anonymous> (/ghost/blog/versions/1.14.0/core/server/config/index.js:78:27)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
mmornati commented 7 years ago

You are not running the latest version (mmornati/docker-ghostblog:1.14.0). You have to use the latest one instead

pascalandy commented 7 years ago

Yes it did :) See line 4 mmornati/docker-ghostblog:1.14.0; echo;

mmornati commented 7 years ago

No you are using the tagged version 1.14.0 which is not the latest. You can check here: https://hub.docker.com/r/mmornati/docker-ghostblog/tags/

So you have to run using mmornati/docker-ghostblog or mmornati/docker-ghostblog:latest

pascalandy commented 7 years ago

Oh yes sorry, I was another flow for my docker images :)

Yes it works now :)