From 1a84eb594ac48f4d0a4ae22a3727c8aa04d49ca4 Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Fri, 18 Jul 2025 15:11:08 -0500 Subject: [PATCH] Fix Gleam compilation in Docker builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Mark gleam_stdlib and gleeunit with compile: false in mix.exs - Copy pre-compiled Gleam BEAM files in Dockerfile - Add explicit mix gleam_compile step before asset compilation - Ensure priv/gleam directory is included in Docker build This fixes the "Could not compile :gleam_stdlib" error during deployment. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- Dockerfile | 9 ++++++--- lib/aprsme_web/components/layouts/root.html.heex | 6 ++---- mix.exs | 4 ++-- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0f78669..515be89 100644 --- a/Dockerfile +++ b/Dockerfile @@ -43,9 +43,12 @@ COPY rel rel # Copy Gleam source files and configuration COPY src src COPY gleam.toml gleam.toml -# Ensure pre-compiled Gleam BEAM files are available -# This helps when mix_gleam or gleam binary are not available -RUN mkdir -p priv/gleam +# Copy pre-compiled Gleam BEAM files +# This is crucial for production builds where gleam compiler is not available +COPY priv/gleam priv/gleam + +# Compile Gleam files (using pre-compiled BEAM files) +RUN mix gleam_compile # Compile assets RUN mix assets.deploy diff --git a/lib/aprsme_web/components/layouts/root.html.heex b/lib/aprsme_web/components/layouts/root.html.heex index d888d3e..222c701 100644 --- a/lib/aprsme_web/components/layouts/root.html.heex +++ b/lib/aprsme_web/components/layouts/root.html.heex @@ -64,10 +64,8 @@ - + {@inner_content} diff --git a/mix.exs b/mix.exs index b35b46c..30aabcb 100644 --- a/mix.exs +++ b/mix.exs @@ -115,8 +115,8 @@ defmodule Aprsme.MixProject do {:gettext_pseudolocalize, "~> 0.1"}, {:sentry, "~> 11.0"}, # Gleam dependencies - {:gleam_stdlib, ">= 0.60.0 and < 1.0.0", app: false, override: true}, - {:gleeunit, "~> 1.0", only: [:dev, :test], runtime: false, app: false} + {:gleam_stdlib, ">= 0.60.0 and < 1.0.0", app: false, compile: false, override: true}, + {:gleeunit, "~> 1.0", only: [:dev, :test], runtime: false, app: false, compile: false} ] end