ARG ELIXIR_VERSION=1.17.3 ARG OTP_VERSION=27.3.4.7 ARG DEBIAN_VERSION=trixie-20260202-slim FROM "docker.io/hexpm/elixir:${ELIXIR_VERSION}-erlang-${OTP_VERSION}-debian-${DEBIAN_VERSION}" # Set the locale ENV LANG=en_US.UTF-8 ENV LANGUAGE=en_US:en ENV LC_ALL=en_US.UTF-8 # Install dependencies RUN apt-get update \ && apt-get install -y --no-install-recommends build-essential make gcc erlang-dev git autoconf automake libtool pkg-config \ && rm -rf /var/lib/apt/lists/* # Create a build directory and copy in the project files WORKDIR /app COPY . . # Compile the application ENV MIX_HOME=/app/.mix RUN mix local.hex --force && mix local.rebar --force RUN mix deps.get --only prod RUN MIX_ENV=prod mix compile # Update the static Swagger documentation RUN MIX_ENV=prod mix phx.swagger.generate # Run as the isidore-dev user USER 1008 # Set environment variables for the application ENV PORT=4000 ENV MIX_ENV="prod" CMD ["mix", "phx.server"]