2017-05-21 3 views
0

ドロッカーコンテナをHerokuホスティングに展開します。 Containerにはnginxと静的ファイルが含まれており、含まれているビルド段階でwebpackによって作成されます。 ルートディレクトリには、資産(画像/など)を備えたindex.htmlを、style.cssに、style.css.map、bundle.js、vendor.bundle.jsとディレクトリと/データ/ WWWでHeroku + docker + nginxすべてのリクエストが返されます。

私のnginxのconfに:

worker_processes auto; 

events { 
    use epoll; 
    multi_accept on; 
} 

http { 
    access_log /dev/stdout; 
    error_log /dev/stdout info; 
    server { 
     include listen.conf; 

     types{ 
      text/javascript js; 
      text/css   css; 
      image/jpeg  jpg; 
      image/png   png; 
     } 
     default_type text/html; 

     root /data/www; 
     index /index.html; 
     location/{ 
      try_files $uri $uri/ /index.html; 
     } 
    } 
} 

それがローカルに動作しますが、私はHerokuのにイメージをプッシュするとき:

docker build -t registry.heroku.com/tp-frontend-kv/web . 
docker push registry.heroku.com/tp-frontend-kv/web 

すべての要求は、Herokuの上でnginxのログを500を返します。

2017-05-21T10:31:09.254234+00:00 heroku[router]: at=info method=GET path="/" host=tp-frontend-kv.herokuapp.com request_id=63388b37-4b9b-432b-88c2-8ae393e2708d fwd="178.22.54.74" dyno=web.1 connect=1ms service=1ms status=500 bytes=355 protocol=https 

2017-05-21T10:31:09.256223+00:00 app[web.1]: 2017/05/21 10:31:09 [error] 14#14: *4 rewrite or internal redirection cycle while internally redirecting to "/index.html", client: 10.84.188.241, server: , request: "GET/HTTP/1.1", host: "tp-frontend-kv.herokuapp.com", referrer: "https://dashboard.heroku.com/" 

2017-05-21T10:31:09.256368+00:00 app[web.1]: 10.84.188.241 - - [21/May/2017:10:31:09 +0000] "GET/HTTP/1.1" 500 193 "https://dashboard.heroku.com/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:53.0) Gecko/20100101 Firefox/53.0" 

2017-05-21T10:31:14.935539+00:00 app[web.1]: 2017/05/21 10:31:14 [error] 13#13: *5 rewrite or internal redirection cycle while internally redirecting to "/index.html", client: 10.84.188.241, server: , request: "GET /index.html HTTP/1.1", host: "tp-frontend-kv.herokuapp.com" 

2017-05-21T10:31:14.935653+00:00 app[web.1]: 10.84.188.241 - - [21/May/2017:10:31:14 +0000] "GET /index.html HTTP/1.1" 500 193 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:53.0) Gecko/20100101 Firefox/53.0" 

2017-05-21T10:31:14.934805+00:00 heroku[router]: at=info method=GET path="/index.html" host=tp-frontend-kv.herokuapp.com request_id=c7a3943b-3714-4745-8758-37002e735d6e fwd="178.22.54.74" dyno=web.1 connect=0ms service=2ms status=500 bytes=355 protocol=https 

何が問題なのですか?

PS dockerfileその他:展開前github

答えて

0

、(HerokuのCLI必須)実行して、ログに目を保つ:

$ heroku logs --app <your-app> -t 

あなたは500を引き起こしているnginxの起動エラーが表示される場合がありそのポート80にバインドしようとした場合の応答、例えば、(デフォルト)あなたがこれを表示されます。

nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied) 

は、これらのエラーに目が離せない、それはそう提供するべきです私の洞察力。

関連する問題