Fix Dockerfile: compile before assets.deploy
All checks were successful
CI - Test, Build, and Push / test (push) Successful in 2m40s
CI - Test, Build, and Push / build-and-push (push) Successful in 46s

- Run mix compile before mix assets.deploy so colocated hooks are generated
- Fix Docker warnings: use AS instead of as, ENV key=value format

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Kevin Sivic 2025-12-01 10:19:28 -05:00
parent 08e2dfa325
commit ad138ddb40

View file

@ -20,7 +20,7 @@ ARG DEBIAN_VERSION=bookworm-20250610-slim
ARG BUILDER_IMAGE="hexpm/elixir:${ELIXIR_VERSION}-erlang-${OTP_VERSION}-debian-${DEBIAN_VERSION}" ARG BUILDER_IMAGE="hexpm/elixir:${ELIXIR_VERSION}-erlang-${OTP_VERSION}-debian-${DEBIAN_VERSION}"
ARG RUNNER_IMAGE="debian:${DEBIAN_VERSION}" ARG RUNNER_IMAGE="debian:${DEBIAN_VERSION}"
FROM ${BUILDER_IMAGE} as builder FROM ${BUILDER_IMAGE} AS builder
# install build dependencies # install build dependencies
RUN apt-get update -y && apt-get install -y build-essential git \ RUN apt-get update -y && apt-get install -y build-essential git \
@ -53,12 +53,12 @@ COPY lib lib
COPY assets assets COPY assets assets
# compile assets # Compile the project first (generates colocated hooks for esbuild)
RUN mix assets.deploy
# Compile the release
RUN mix compile RUN mix compile
# compile assets (must happen after mix compile for colocated hooks)
RUN mix assets.deploy
# Changes to config/runtime.exs don't require recompiling the code # Changes to config/runtime.exs don't require recompiling the code
COPY config/runtime.exs config/ COPY config/runtime.exs config/
@ -76,9 +76,9 @@ RUN apt-get update -y && \
# Set the locale # Set the locale
RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen
ENV LANG en_US.UTF-8 ENV LANG=en_US.UTF-8
ENV LANGUAGE en_US:en ENV LANGUAGE=en_US:en
ENV LC_ALL en_US.UTF-8 ENV LC_ALL=en_US.UTF-8
WORKDIR "/app" WORKDIR "/app"
RUN chown nobody /app RUN chown nobody /app