fix: compile C NIF explicitly in Docker build

Add explicit 'make' step in Dockerfile to compile the C NIF before
Elixir compilation. This ensures towerops_nif.so exists when the
Elixir code tries to load it.

The custom compiler task creates a bootstrap problem (needs to be
compiled before it can be used as a compiler), so we compile the
C NIF explicitly instead of relying on the compilers list.
This commit is contained in:
Graham McIntire 2026-01-30 13:04:06 -06:00
parent 25397139c1
commit 65f0f23c93
2 changed files with 4 additions and 1 deletions

View file

@ -65,6 +65,9 @@ COPY priv priv
COPY c_src c_src
# Compile the C NIF before Elixir compilation
RUN cd c_src && make
COPY lib lib
# Compile the release

View file

@ -10,7 +10,7 @@ defmodule Towerops.MixProject do
start_permanent: Mix.env() == :prod,
aliases: aliases(),
deps: deps(),
compilers: [:towerops_nif, :phoenix_live_view] ++ Mix.compilers(),
compilers: [:phoenix_live_view] ++ Mix.compilers(),
listeners: [Phoenix.CodeReloader],
dialyzer: dialyzer()
]