From 1d47eef51fda3c77e414b0e5d1b714bd765f911a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20Oc=C3=B3n-C=C3=A1rdenas?= Date: Fri, 15 Nov 2024 10:25:58 +0100 Subject: [PATCH] more tests for the ARG --- Dockerfile | 3 +++ README.md | 22 ++++++++++++---------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1b64a2c..4900423 100644 --- a/Dockerfile +++ b/Dockerfile @@ -43,6 +43,9 @@ ENV MIX_ENV="prod" # Add JPperf as workaround for the failure on building the code in Github actions # It should not be necessary with QEMU 8.1, and it introduces some security issues, so delete as as soon as possible # ENV ERL_FLAGS="+JMsingle true" +ARG ERL_FLAGS="" +ENV ERL_FLAGS=${ERL_FLAGS} + # install mix dependencies COPY mix.exs mix.lock ./ diff --git a/README.md b/README.md index b8a1d77..a550665 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,20 @@ # Counter -To start your Phoenix server: +A Phoenix LiveView application that runs on a container in Kubernetes. It shows a counter with + and - buttons, and synchronizes the state between all visitors +Use the Dockerfile in the root to create an image that is suitable to be run in Kubernetes. + + +To start your Phoenix server locally: * Run `mix setup` to install and setup dependencies * Start Phoenix endpoint with `mix phx.server` or inside IEx with `iex -S mix phx.server` Now you can visit [`localhost:4000`](http://localhost:4000) from your browser. -Ready to run in production? Please [check our deployment guides](https://hexdocs.pm/phoenix/deployment.html). - -## Learn more - - * Official website: https://www.phoenixframework.org/ - * Guides: https://hexdocs.pm/phoenix/overview.html - * Docs: https://hexdocs.pm/phoenix - * Forum: https://elixirforum.com/c/phoenix-forum - * Source: https://github.com/phoenixframework/phoenix +To run it in Kubernetes: +1. Build the image using the Dockerfile. There is configuration to use GitHub actions to automatically build a new image. +2. Run the image using the manifests in the Kubernetes folder + Secret to store the KEY_SECRET_BASE + Deployment that uses the Secret + Service to publish the endpoint + PHX_HOME that points to the service