From f1ead99e24ebdb9b1e255963fb13707c0bdb5c04 Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Fri, 20 Feb 2026 10:18:48 -0600 Subject: [PATCH] Split Dockerfile build steps for better layer caching --- Dockerfile | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index b271b5b..2a04830 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,17 +27,19 @@ COPY mix.exs mix.lock ./ RUN mix deps.get --only $MIX_ENV && \ mix deps.compile -# Copy and compile application +# Copy config and application code, then compile COPY config config COPY lib lib +RUN mix compile + +# Copy assets and static files, then deploy assets COPY assets assets COPY priv priv -COPY rel rel +RUN mix assets.deploy -# Build application -RUN mix compile && \ - mix assets.deploy && \ - mix release +# Copy release config and build release +COPY rel rel +RUN mix release # Runtime stage FROM ${RUNNER_IMAGE}