runtime.exs 825 B

123456789101112131415161718192021222324252627
  1. import Config
  2. alias Config.Helper
  3. # config/runtime.exs is executed for all environments, including
  4. # during releases. It is executed after compilation and before the
  5. # system starts, so it typically used load production configuration
  6. # and secrets from environment variables or elsewhere. Do not define
  7. # any compile-time configuration in here, as it won't be applied.
  8. # The block below contains prod specific runtime configuration.
  9. if config_env() == :prod do
  10. env =
  11. Helper.load_all([
  12. "SECRET_KEY_BASE",
  13. "PORT",
  14. "HOST"
  15. ])
  16. config :vaccins, VaccinsWeb.Endpoint,
  17. secret_key_base: env.secret_key_base,
  18. url: [host: env.host, port: env.port],
  19. http: [
  20. port: String.to_integer(env.port),
  21. net: :inet,
  22. transport_options: [socket_opts: [:inet6]]
  23. ],
  24. server: true
  25. end