Something went wrong. Try again.
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889# This file is based on these images:## - https://hub.docker.com/r/hexpm/elixir/tags - for the build image# - https://hub.docker.com/_/debian/tags?name=trixie- - for the release image#ARG ELIXIR_VERSION=1.20.4ARG OTP_VERSION=29.1.1ARG DEBIAN_VERSION=trixie-20260918-slim
ARG BUILDER_IMAGE="docker.io/hexpm/elixir:${ELIXIR_VERSION}-erlang-${OTP_VERSION}-debian-${DEBIAN_VERSION}"ARG RUNNER_IMAGE="docker.io/library/debian:${DEBIAN_VERSION}"
FROM ${BUILDER_IMAGE} AS builder
# install build dependenciesRUN apt-get update \ && apt-get install -y --no-install-recommends build-essential git
# prepare build dirWORKDIR /app
# install hex + rebarRUN mix local.hex --force \ && mix local.rebar --force
# set build ENVENV MIX_ENV="prod"
# install mix dependenciesCOPY mix.exs mix.lock ./RUN mix deps.get --only $MIX_ENVRUN mkdir config
# copy compile-time config files before we compile dependencies# to ensure any relevant config change will trigger the dependencies# to be re-compiled.COPY config/config.exs config/${MIX_ENV}.exs config/RUN mix deps.compile
RUN mix assets.setup
COPY priv priv
COPY lib lib
# Compile the releaseRUN mix compile
COPY assets assets
# compile assetsRUN mix assets.deploy
# Changes to config/runtime.exs don't require recompiling the codeCOPY config/runtime.exs config/
COPY rel relRUN mix release
# start a new build stage so that the final image will only contain# the compiled release and other runtime necessitiesFROM ${RUNNER_IMAGE} AS final
RUN apt-get update \ && apt-get install -y --no-install-recommends tini libstdc++6 openssl libncurses6 locales ca-certificates curl
# Set the localeRUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen \ && locale-gen
ENV LANG=en_US.UTF-8ENV LANGUAGE=en_US:enENV LC_ALL=en_US.UTF-8
WORKDIR "/app"RUN chown nobody /app
# set runner ENVENV MIX_ENV="prod"
# Only copy the final release from the build stageCOPY --from=builder --chown=nobody:root /app/_build/${MIX_ENV}/rel/kloevaa ./
USER nobody
ENTRYPOINT ["tini", "--"]
CMD ["/app/bin/server"]