dokku port fixes
This commit is contained in:
parent
95409d3e59
commit
e107cd7a4b
2 changed files with 12 additions and 3 deletions
|
|
@ -146,4 +146,5 @@ LABEL org.opencontainers.image.vendor="APRS.me" \
|
|||
security.privileged="false"
|
||||
|
||||
# Container configuration is handled by Dokku
|
||||
EXPOSE $PORT
|
||||
# Port is set dynamically by Dokku via PORT environment variable
|
||||
EXPOSE 5000
|
||||
|
|
|
|||
|
|
@ -16,8 +16,12 @@ import Config
|
|||
#
|
||||
# Alternatively, you can use `mix phx.gen.release` to generate a `bin/server`
|
||||
# script that automatically sets the env var above.
|
||||
if System.get_env("PHX_SERVER") do
|
||||
# Always start the server in production/docker environments
|
||||
if System.get_env("PHX_SERVER") || config_env() == :prod do
|
||||
config :aprs, AprsWeb.Endpoint, server: true
|
||||
IO.puts("Phoenix server enabled - will start HTTP listener")
|
||||
else
|
||||
IO.puts("Phoenix server disabled - no HTTP listener will start")
|
||||
end
|
||||
|
||||
if config_env() == :prod do
|
||||
|
|
@ -44,6 +48,7 @@ if config_env() == :prod do
|
|||
|
||||
host = System.get_env("PHX_HOST") || "example.com"
|
||||
port = String.to_integer(System.get_env("PORT") || "4000")
|
||||
IO.puts("Phoenix will bind to port: #{port}")
|
||||
|
||||
config :aprs, Aprs.Repo,
|
||||
# ssl: true,
|
||||
|
|
@ -61,7 +66,10 @@ if config_env() == :prod do
|
|||
ip: {0, 0, 0, 0},
|
||||
port: port
|
||||
],
|
||||
secret_key_base: secret_key_base
|
||||
secret_key_base: secret_key_base,
|
||||
server: true
|
||||
|
||||
IO.puts("Phoenix endpoint configured for host: #{host}, port: #{port}")
|
||||
|
||||
# config :aprs, :dns_cluster_query, System.get_env("DNS_CLUSTER_QUERY")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue