Tag: 凤凰框架

Erlang和Phoenix的bug,低码率的Docker

我目前正试图在docker集装箱中build立一个Phoenix服务器。 Docker镜像的创build工作正常,但是当试图运行它时,会出现一个错误: MIX_ENV=prod mix phoenix.server {"Kernel pid terminated",application_controller,"{application_start_failure,satisfaction,{{shutdown,{failed_to_start_child,'Elixir.Satisfaction.Endpoint',{'EXIT',{low_entropy,[{crypto,strong_rand_bytes,1,[{file,\"crypto.erl\"},{line,436}]},{'Elixir.Phoenix.Endpoint.Adapter',config_children,2,[{file,\"lib/phoenix/endpoint/adapter.ex\"},{line,34}]},{'Elixir.Phoenix.Endpoint.Adapter',start_link,2,[{file,\"lib/phoenix/endpoint/adapter.ex\"},{line,18}]},{supervisor,do_start_child,2,[{file,\"supervisor.erl\"},{line,358}]},{supervisor,start_children,3,[{file,\"supervisor.erl\"},{line,341}]},{supervisor,init_children,2,[{file,\"supervisor.erl\"},{line,307}]},{gen_server,init_it,6,[{file,\"gen_server.erl\"},{line,328}]},{proc_lib,init_p_do_apply,3,[{file,\"proc_lib.erl\"},{line,240}]}]}}}},{'Elixir.Satisfaction',start,[normal,[]]}}}"} Crash dump is being written to: erl_crash.dump…done Kernel pid terminated (application_controller) ({application_start_failure,satisfaction,{{shutdown,{failed_to_start_child,'Elixir.Satisfaction.Endpoint',{'EXIT',{low_entropy,[{crypto,strong_rand_byt 我不明白为什么,有没有人有一个想法? 谢谢 最好的祝福,

启动一个Phoenix应用程序,出现错误(UndefinedFunctionError)

使用docker构build一个映像来部署,得到: [info] Application myapp exited: exited in: myapp.Application.start(:normal, []) ** (EXIT) an exception was raised: ** (UndefinedFunctionError) function myapp.Application.start/2 is undefined (module myapp.Application is not available) myapp.Application.start(:normal, []) (kernel) application_master.erl:273: :application_master.start_it_old/4 {"Kernel pid terminated",application_controller,"{application_start_failure,myapp,{bad_return,{{'Elixir.myapp.Application',start,[normal,[]]},{'EXIT',{undef,[{'Elixir.myapp.Application',start,[normal,[]],[]},{application_master,start_it_old,4,[{file,\"application_master.erl\"},{line,273}]}]}}}}}"} Kernel pid terminated (application_controller) ({application_start_failure,myapp,{bad_return,{{'Elixir.myapp.Application',start,[normal,[]]},{'EXIT',{undef,[{'Elixir.myapp.Application',start,[norma 在myapp/rel/config.exs文件中: … release :orange do set version: current_version(:orange) set applications: [ :runtime_tools ] set vm_args: "./vm.args" […]

Docker + Elixir / Phoenix的旧版本

我被要求将一个Elixir / Phoenix应用程序移动到Docker,而我没有以前的经验。 该应用程序使用非最新版本的Elixir和Phoenix,所以我不得不偏离在线代码,通常关注最新版本。 这导致我写这个Dockerfile # FROM bitwalker/alpine-elixir:latest FROM bitwalker/alpine-elixir:1.3.4 MAINTAINER Paul Schoenfelder <paulschoenfelder@gmail.com> # Important! Update this no-op ENV variable when this Dockerfile # is updated with the current date. It will force refresh of all # of the base images and things like `apt-get update` won't be using # old cached versions when […]

Docker:如何在不暴露端口的情况下连接到Postgresql容器

我在docker容器中设置了Elixir / Phoenix应用程序,为Postgresql服务器设置了单独的容器。 当我公开5432端口时,我只能连接到Postgresql服务器。 但我不希望港口公开,因为这是相当不安全的。 Postgresql服务器应该只能从phoenix容器访问。 但是,如果我不暴露端口,我只是在凤凰容器中出现“连接被拒绝”的错误。 app-phoenix-1 | 2016-03-15T11:41:32.701295542Z ** (Mix) The database for App.Repo couldn't be created, reason given: psql: could not connect to server: Connection refused app-phoenix-1 | 2016-03-15T11:41:32.701369511Z Is the server running on host "POSTGRES" (10.7.0.7) and accepting app-phoenix-1 | 2016-03-15T11:41:32.701395350Z TCP/IP connections on port 5432? 我链接的服务,并没有得到,为什么它不工作。 Postgresql已经启动并正在运行。 Postgres容器的日志文件中没有任何内容。 这是我的节点上的docker ps的结果: […]

Phoenix Framework – Docker镜像,用于开发和部署到Kubernetes

我试图找出在我的开发环境中使用Docker容器的最佳方式,但将我的应用的版本化的图像部署到Kubernetes。 以下是我到目前为止: 我使用下面的Docker镜像作为基础 – https://github.com/shufo/docker-phoenix 。 当我为我的开发环境创build容器(按照说明)时,我运行: docker run -d -p 4000:4000 -v $(pwd):/app -w /app shufo/phoenix 据我所知,对于Kubernetes,我的应用程序需要包含在版本化的图像。 换句话说,代码需要在生成的容器中,而不是传递到容器中的容量? 所以我有一个Dockerfile,看起来像这样: FROM shufo/phoenix MAINTAINER Hamish Murphy <hamishmurphy@gmail.com> COPY . /app WORKDIR /app 在生成映像(带有版本号)后,我可以使用它在Kubernetes中创build一个部署。 所以这是一个家庭解决scheme。 这有一个共同的模式吗?

Docker容器在〜1分钟后死亡

我做了一个非常小的凤凰框架应用程序(只是稍微修改了你运行时得到的:mix phoenix.new)。 我一直在试图部署在Docker容器中。 它在容器运行的时候工作正常,但是在启动的一分钟内总是死掉,并且显示“Killed”消息。 我是否提出要求似乎并不重要。 我试着看docker事件,得到以下结果: $ docker events 2016-04-09T16:24:02.538602484-04:00 container create ef45a768723c64125c717a7b40ee7513e477f27339c6266bd28cc3084c60e11f (image=gcr.io/myprojectname/myapp:v2, name=amazing_bhabha) 2016-04-09T16:24:02.550438045-04:00 container attach ef45a768723c64125c717a7b40ee7513e477f27339c6266bd28cc3084c60e11f (image=gcr.io/myprojectname/myapp:v2, name=amazing_bhabha) 2016-04-09T16:24:02.599731705-04:00 network connect c64a1439c8095f82ab0fea5c48b563c8aac7256d6064b3189b0bc8d052d69fe4 (name=bridge, type=bridge, container=ef45a768723c64125c717a7b40ee7513e477f27339c6266bd28cc3084c60e11f) 2016-04-09T16:24:02.600048755-04:00 container start ef45a768723c64125c717a7b40ee7513e477f27339c6266bd28cc3084c60e11f (image=gcr.io/myprojectname/myapp:v2, name=amazing_bhabha) 2016-04-09T16:24:53.858352733-04:00 container die ef45a768723c64125c717a7b40ee7513e477f27339c6266bd28cc3084c60e11f (name=amazing_bhabha, image=gcr.io/myprojectname/myapp:v2) 2016-04-09T16:24:53.930349810-04:00 network disconnect c64a1439c8095f82ab0fea5c48b563c8aac7256d6064b3189b0bc8d052d69fe4 (container=ef45a768723c64125c717a7b40ee7513e477f27339c6266bd28cc3084c60e11f, name=bridge, type=bridge) 对于Docker和Elixir,我还是很新的,所以我不确定我能做些什么其他的研究。 这里有一个类似的问题: 我运行一个docker集装箱,但几分钟后,它被自己杀死了 但是我不确定OP是如何解决的。 预先感谢任何提示。 请让我知道,如果有任何其他信息,我可以得到这可能有帮助。 编辑1:我了解到docker ps […]