Skip to content

Instantly share code, notes, and snippets.

@damonvjanis
Last active April 6, 2023 03:38
Show Gist options
  • Select an option

  • Save damonvjanis/24f83da1c982e7ab4e4bffc543d5ff2f to your computer and use it in GitHub Desktop.

Select an option

Save damonvjanis/24f83da1c982e7ab4e4bffc543d5ff2f to your computer and use it in GitHub Desktop.

Revisions

  1. damonvjanis renamed this gist Apr 6, 2023. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. damonvjanis revised this gist Apr 6, 2023. 1 changed file with 8 additions and 3 deletions.
    11 changes: 8 additions & 3 deletions releases.exs
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,11 @@
    import Config

    # Set ports based on environment variables in the release
    config :my_app, MyAppWeb.Endpoint,
    http: [port: String.to_integer(System.get_env("HTTP_PORT"))],
    https: [port: String.to_integer(System.get_env("HTTPS_PORT"))]
    http_port = System.get_env("HTTP_PORT")
    https_port = System.get_env("HTTPS_PORT")

    if http_port && https_port do
    config :my_app, MyAppWeb.Endpoint,
    http: [port: String.to_integer(http_port)],
    https: [port: String.to_integer(https_port)]
    end
  3. damonvjanis created this gist Jun 2, 2021.
    6 changes: 6 additions & 0 deletions releases.exs
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    import Config

    # Set ports based on environment variables in the release
    config :my_app, MyAppWeb.Endpoint,
    http: [port: String.to_integer(System.get_env("HTTP_PORT"))],
    https: [port: String.to_integer(System.get_env("HTTPS_PORT"))]