Fix Gleam compilation in Docker builds
- 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 <noreply@anthropic.com>
This commit is contained in:
parent
18521ed0c1
commit
1a84eb594a
3 changed files with 10 additions and 9 deletions
|
|
@ -43,9 +43,12 @@ COPY rel rel
|
||||||
# Copy Gleam source files and configuration
|
# Copy Gleam source files and configuration
|
||||||
COPY src src
|
COPY src src
|
||||||
COPY gleam.toml gleam.toml
|
COPY gleam.toml gleam.toml
|
||||||
# Ensure pre-compiled Gleam BEAM files are available
|
# Copy pre-compiled Gleam BEAM files
|
||||||
# This helps when mix_gleam or gleam binary are not available
|
# This is crucial for production builds where gleam compiler is not available
|
||||||
RUN mkdir -p priv/gleam
|
COPY priv/gleam priv/gleam
|
||||||
|
|
||||||
|
# Compile Gleam files (using pre-compiled BEAM files)
|
||||||
|
RUN mix gleam_compile
|
||||||
|
|
||||||
# Compile assets
|
# Compile assets
|
||||||
RUN mix assets.deploy
|
RUN mix assets.deploy
|
||||||
|
|
|
||||||
|
|
@ -64,10 +64,8 @@
|
||||||
</script>
|
</script>
|
||||||
<script defer phx-track-static type="text/javascript" src={~p"/assets/app.js"}>
|
<script defer phx-track-static type="text/javascript" src={~p"/assets/app.js"}>
|
||||||
</script>
|
</script>
|
||||||
<script
|
<script src="https://js.sentry-cdn.com/be4b53768e7c243cc72fa78ee7b7ec8c.min.js" crossorigin="anonymous">
|
||||||
src="https://js.sentry-cdn.com/be4b53768e7c243cc72fa78ee7b7ec8c.min.js"
|
</script>
|
||||||
crossorigin="anonymous"
|
|
||||||
></script>
|
|
||||||
</head>
|
</head>
|
||||||
<body class={body_class(assigns)}>
|
<body class={body_class(assigns)}>
|
||||||
{@inner_content}
|
{@inner_content}
|
||||||
|
|
|
||||||
4
mix.exs
4
mix.exs
|
|
@ -115,8 +115,8 @@ defmodule Aprsme.MixProject do
|
||||||
{:gettext_pseudolocalize, "~> 0.1"},
|
{:gettext_pseudolocalize, "~> 0.1"},
|
||||||
{:sentry, "~> 11.0"},
|
{:sentry, "~> 11.0"},
|
||||||
# Gleam dependencies
|
# Gleam dependencies
|
||||||
{:gleam_stdlib, ">= 0.60.0 and < 1.0.0", app: false, override: true},
|
{: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}
|
{:gleeunit, "~> 1.0", only: [:dev, :test], runtime: false, app: false, compile: false}
|
||||||
]
|
]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue