2016-09-05 6 views
2

私はhttps://hexdocs.pm/distillery/getting-started.htmlのドキュメントを通っていますが、基本的なPhoenixアプリケーションを稼働させることはできません。ここで私は何をすべきかです:蒸留所リリース用の設定

mix phoenix.new test_app --no-ecto 
cd test_app 

私は蒸留所の一部を含むmix.exsファイルを更新したより:

[...] 
defp deps do 
    [{:phoenix, "~> 1.2.0-rc"}, 
    {:phoenix_pubsub, "~> 1.0.0-rc"}, 
    {:phoenix_html, "~> 2.5"}, 
    {:phoenix_live_reload, "~> 1.0", only: :dev}, 
    {:gettext, "~> 0.11"}, 
    {:cowboy, "~> 1.0"}, 
    {:distillery, "~> 0.9"}] 
end 
[...] 

私は、次のコマンドを実行したより:このになり

mix deps.get 
mix compile 
mix release.init 
export PORT=4000 
./node_modules/brunch/bin/brunch b -p 
MIX_ENV=prod mix do phoenix.digest, release --env=prod 

を:

05 Sep 17:16:02 - info: compiled 6 files into 2 files, copied 3 in 1.7 sec 
Check your digested files at "priv/static" 
==> Assembling release.. 
==> Building release test_app:0.0.1 using environment prod 
==> Packaging release.. 
==> Release successfully built! 
    You can run it in one of the following ways: 
     Interactive: rel/test_app/bin/test_app console 
     Foreground: rel/test_app/bin/test_app foreground 
     Daemon: rel/test_app/bin/test_app start 

私の理解では、私は、コマンド

rel/test_app/bin/test_app foreground 

でフェニックスのアプリケーションを起動することができるはずです。しかし、私はこれを行うとき、私はURL http://localhost:4000

にブラウザ経由でアクセスすることはできません私が間違っを持っていますかセットアップ、または私はシステムを誤解していますか?どうすれば新しいリリースを開始できますか?

答えて

4

Using Distillery With Phoenixページで説明したように、一部の設定をconfig/prod.exsに変更する必要があります。 TestApp.Endpoint設定を変更した後:

config :test_app, TestApp.Endpoint, 
    http: [port: {:system, "PORT"}], 
    url: [host: "localhost", port: {:system, "PORT"}], 
    cache_static_manifest: "priv/static/manifest.json", 
    server: true, 
    root: ".", 
    version: Mix.Project.config[:version] 

次のコマンドが正常に以前にエクスポートされたポートでフェニックスを開始します:

rel/test_app/bin/test_app foreground 
関連する問題