首页 > 解决方案 > 获取“无法配置”版本!与酿酒厂

问题描述

我正在尝试发布 Distillery 版本并Unable to configure release!在运行时收到消息_build/dev/rel/acompanhante/bin/acompanhante foreground

酒厂的发布配置模块用于:

...

alias Distillery.Releases.Config.Providers.Elixir, as: RuntimeConfig

environment :dev do
  set dev_mode: true
  set include_erts: false
  set cookie: :"gOjXA4x?QPjR0c*$/yIq9{S&/s]p}}K?gNz_$O4Uf6I[Ql/L(g7*:st70YPY={?$"
end

environment :prod do
  set include_erts: true
  set include_src: false
  set cookie: :"OzWR<VV9?T=2o=F@9KxRTTm|CIGO/BoT9p_^D/QN6CY3}v<4?;yRjhR(v^nz1fvR"
  set vm_args: "rel/vm.args"
end

release :acompanhante do
  set config_providers: [{RuntimeConfig, ["${RELEASE_ROOT_DIR}/etc/config.exs"]}]
  set overlays: [{:copy, "config/releases.exs", "etc/config.exs"}]
  set version: current_version(:acompanhante)
  set applications: [
    :runtime_tools,
    :logger
  ]
end

用于配置运行时的模块:

import Config

...

config :acompanhante, Acompanhante.Repo,
  adapter: Ecto.Adapters.Postgres,
  ssl: true,
  url: database_url,
  pool_size: String.to_integer(System.get_env("POOL_SIZE") || "10")

config :acompanhante, AcompanhanteWeb.Endpoint,
  http: [
    port: String.to_integer(System.get_env("PORT") || "4000"),
    transport_options: [socket_opts: [:inet6]]
  ],
  secret_key_base: secret_key_base,
  code_reloader: false

我在构建应用程序时做错了什么?

标签: elixirphoenixdistillery

解决方案


需要配置运行时:

release :acompanhante do
  set config_providers: [{RuntimeConfig, ["${RELEASE_ROOT_DIR}/etc/runtime.exs"]}]
  set overlays: [{:copy, "config/releases.exs", "etc/runtime.exs"}]
  ...
end

推荐阅读