Skip to content

Instantly share code, notes, and snippets.

@larsw
Created September 28, 2025 19:19
Show Gist options
  • Save larsw/d6e7d18e5f8d2897f9d58b5e25a18809 to your computer and use it in GitHub Desktop.
Save larsw/d6e7d18e5f8d2897f9d58b5e25a18809 to your computer and use it in GitHub Desktop.
gleam-node
FROM erlang:alpine
# Install Gleam
RUN apk add --no-cache bash git curl build-base \
&& curl -L https://github.com/gleam-lang/gleam/releases/download/v1.12.0/gleam-v1.12.0-x86_64-unknown-linux-musl.tar.gz \
| tar -xz -C /usr/local/bin \
&& chmod +x /usr/local/bin/gleam
RUN wget -qO /usr/local/bin/rebar3 https://s3.amazonaws.com/rebar3/rebar3 \
&& chmod +x /usr/local/bin/rebar3
# Fetch and compile observer_cli + all its deps
RUN mkdir -p /opt/observer_build \
&& cd /opt/observer_build \
&& rebar3 new lib dummy \
&& cd dummy \
&& echo '{deps, [observer_cli]}.' > rebar.config \
&& rebar3 compile \
&& mkdir -p /opt/erlang_libs \
&& cp -r _build/default/lib/* /opt/erlang_libs/
# Make all those libs available to any Erlang VM automatically
ENV ERL_LIBS="/opt/erlang_libs"
# Create app dir
WORKDIR /app
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment