runtime.exs 979 B

1234567891011121314151617181920212223242526272829303132
  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_IP"
  15. ])
  16. config :vaccins, VaccinsWeb.Endpoint,
  17. secret_key_base: env.secret_key_base,
  18. url: [host: env.host_ip, port: env.port],
  19. http: [
  20. port: String.to_integer(env.port),
  21. net: :inet,
  22. transport_options: [socket_opts: [:inet6]]
  23. ],
  24. check_origin: [
  25. "http://localhost:#{env.port}",
  26. "http://192.168.0.13:#{env.port}",
  27. "http://#{env.host_ip}:#{env.port}"
  28. ],
  29. server: true
  30. end