From 816fedb75c82ebcf35e0f0303e8e8bbace11c43d Mon Sep 17 00:00:00 2001 From: Preston Mueller Date: Mon, 3 Jun 2024 14:11:59 -0400 Subject: [PATCH 1/2] Switch port to 4001 --- .github/workflows/ci.yml | 2 +- Dockerfile | 4 ++-- README.md | 2 +- config/dev.exs | 2 +- config/runtime.exs | 2 +- docker-compose.yml | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 86b4af38..96e3b0b7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -174,7 +174,7 @@ jobs: - name: docker compose up run: docker compose up --wait - name: ensure running properly - run: docker compose exec --no-TTY orbit wget --spider -S http://localhost:4000/ + run: docker compose exec --no-TTY orbit wget --spider -S http://localhost:4001/ - name: show docker container logs run: docker compose logs orbit if: ${{ !cancelled() }} diff --git a/Dockerfile b/Dockerfile index aefded56..3e16c138 100644 --- a/Dockerfile +++ b/Dockerfile @@ -56,7 +56,7 @@ RUN mix release --path /app-release FROM alpine:3.19.1 AS runtime # HTTP port -EXPOSE 4000 +EXPOSE 4001 # Erlang depends on these RUN apk add --no-cache ncurses-libs libstdc++ libgcc @@ -71,6 +71,6 @@ USER orbit WORKDIR /home/orbit # Run properly in production -ENV PORT=4000 MIX_ENV=prod TERM=xterm LANG="C.UTF-8" +ENV PORT=4001 MIX_ENV=prod TERM=xterm LANG="C.UTF-8" COPY --from=elixir --chown=orbit:orbit /app-release . CMD ["bin/orbit", "start"] diff --git a/README.md b/README.md index f490087a..9bfd5d71 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Run the server with `mix phx.server`. -Now you can visit [`localhost:4000`](http://localhost:4000) from your browser. +Now you can visit [`localhost:4001`](http://localhost:4001) from your browser. ## Docker diff --git a/config/dev.exs b/config/dev.exs index dd7f2dfc..5d950e50 100644 --- a/config/dev.exs +++ b/config/dev.exs @@ -25,7 +25,7 @@ config :orbit, Orbit.Repo, config :orbit, OrbitWeb.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: 4001], check_origin: false, code_reloader: true, debug_errors: true, diff --git a/config/runtime.exs b/config/runtime.exs index 77673f0d..66ae1cd4 100644 --- a/config/runtime.exs +++ b/config/runtime.exs @@ -44,7 +44,7 @@ if config_env() == :prod do """ host = System.get_env("PHX_HOST") || "example.com" - port = String.to_integer(System.get_env("PORT") || "4000") + port = String.to_integer(System.get_env("PORT") || "1") config :orbit, OrbitWeb.Endpoint, url: [host: host, port: 443, scheme: "https"], diff --git a/docker-compose.yml b/docker-compose.yml index ea6cd06a..230f52de 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -18,4 +18,4 @@ services: - DATABASE_DISABLE_SSL=insecure-yes - SECRET_KEY_BASE=/insecure/insecure/insecure/insecure/insecure/insecure/insecure/ ports: - - 4000 + - 4001 From 1d30a677e36ec251cd012fe06b63dc3811cad456 Mon Sep 17 00:00:00 2001 From: Preston Mueller Date: Mon, 3 Jun 2024 16:00:26 -0400 Subject: [PATCH 2/2] Oops --- config/runtime.exs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/runtime.exs b/config/runtime.exs index 66ae1cd4..5c88626a 100644 --- a/config/runtime.exs +++ b/config/runtime.exs @@ -44,7 +44,7 @@ if config_env() == :prod do """ host = System.get_env("PHX_HOST") || "example.com" - port = String.to_integer(System.get_env("PORT") || "1") + port = String.to_integer(System.get_env("PORT") || "4001") config :orbit, OrbitWeb.Endpoint, url: [host: host, port: 443, scheme: "https"],