Skip to content

Commit

Permalink
global environment for the state in the deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
chargio committed Nov 19, 2024
1 parent 2c33c86 commit 176f5ae
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 3 deletions.
10 changes: 10 additions & 0 deletions Kubernetes/k8s-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,16 @@ spec:
env:
- name: PHX_HOST
value: raspberry5b.local # Make this the IP or CNAME of the main host or LB
- name: RELEASE_DISTRIBUTION
value: name
- name: NODE_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: RELEASE_NODE
value: "counter@$(NODE_IP)"
- name: DNS_CLUSTER_QUERY
value: "counter-headless-svc.default.svc.cluster.local"
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
Expand Down
Empty file.
2 changes: 1 addition & 1 deletion config/dev.exs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Config
config :counter, CounterWeb.Endpoint,
# Binding to loopback ipv4 address prevents access from other machines.
# Change to `ip: {0, 0, 0, 0}` to allow access from other machines.
http: [ip: {127, 0, 0, 1}, port: 4000],
http: [ip: {127, 0, 0, 1}, port: System.get_env("PORT") || 4000],
check_origin: false,
code_reloader: true,
debug_errors: true,
Expand Down
2 changes: 1 addition & 1 deletion lib/counter_web/live/counter_state.ex
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule Counter.Count do
use GenServer
alias Phoenix.PubSub
@name :count_server
@name {:global, :count_server}

@start_value 0

Expand Down
3 changes: 2 additions & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ defmodule Counter.MixProject do
def project do
[
app: :counter,
version: "0.1.0",
version: "0.2.0",
elixir: "~> 1.14",
elixirc_paths: elixirc_paths(Mix.env()),
start_permanent: Mix.env() == :prod,
Expand All @@ -30,6 +30,7 @@ defmodule Counter.MixProject do
[
mod: {Counter.Application, []},
extra_applications: [:logger, :runtime_tools]
# extra_applications: [:logger, :runtime_tools, :observer, :wx]
]
end

Expand Down

0 comments on commit 176f5ae

Please sign in to comment.