[Bugfix] Expose port in Dockerfile and force IPv4 (#129)

* Exposes port on built image

* Forced IPv4

* Added current version to sidebar
This commit is contained in:
Kieran 2024-03-26 08:54:20 -07:00 committed by GitHub
parent bf11cd0dd9
commit f42aab286a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 10 additions and 2 deletions

View file

@ -102,7 +102,7 @@ if config_env() == :prod do
# Set it to {0, 0, 0, 0, 0, 0, 0, 1} for local network only access.
# See the documentation on https://hexdocs.pm/plug_cowboy/Plug.Cowboy.html
# for details about using IPv6 vs IPv4 and loopback vs public addresses.
ip: {0, 0, 0, 0, 0, 0, 0, 0},
ip: {0, 0, 0, 0},
port: String.to_integer(System.get_env("PORT") || "4000")
],
secret_key_base: secret_key_base

View file

@ -57,6 +57,11 @@
<.icon name="hero-currency-dollar" /> Donate
</span>
</li>
<li>
<span class="group relative flex items-center gap-2.5 px-4 py-2 text-sm">
v<%= Application.spec(:pinchflat)[:vsn] %>
</span>
</li>
</ul>
</nav>
</section>

View file

@ -75,6 +75,8 @@ RUN mix release
# the compiled release and other runtime necessities
FROM ${RUNNER_IMAGE}
ARG PORT=8945
RUN apt-get update -y
RUN apt-get install -y libstdc++6 openssl libncurses5 locales ca-certificates \
ffmpeg curl git openssh-client nano
@ -101,8 +103,9 @@ RUN chown nobody /config /downloads
# set runner ENV
ENV MIX_ENV="prod"
ENV PORT=8945
ENV PORT=${PORT}
ENV RUN_CONTEXT="selfhosted"
EXPOSE ${PORT}
# Only copy the final release from the build stage
COPY --from=builder --chown=nobody:root /app/_build/${MIX_ENV}/rel/pinchflat ./