# Stage 1: Build FROM elixir:1.15-slim AS build # Install build dependencies RUN apt-get update && apt-get install -y --no-install-recommends git npm build-essential cmake # Clone Keila repository RUN git clone --depth 1 --branch v0.15.0 https://github.com/pentacent/keila.git /keila WORKDIR /keila # Install Elixir and NPM dependencies ENV MIX_ENV=prod RUN mix local.hex --force && \ mix local.rebar --force && \ mix deps.get --only prod && \ mix deps.compile RUN npm ci --prefix ./assets # Build the release ENV RELEASE_INCLUDE_ERTS=true RUN echo 'config :tzdata, autoupdate: :disabled' >> /keila/config/config.exs RUN mix assets.deploy && \ mix release # Stage 2: Runtime FROM cloudron/base:5.0.0 RUN mkdir -p /app/code /app/data COPY --from=build /keila/_build/prod/rel/keila /app/code COPY start.sh /app/code/ RUN chmod +x /app/code/start.sh RUN chown -R cloudron:cloudron /app/code /app/data CMD ["/app/code/start.sh"]