FROM erlang:28-alpine AS builder RUN for i in 1 2 3 4 5; do \ apk add --no-cache elixir nodejs npm git && break; \ echo "apk retry $i/5..."; sleep 15; \ done WORKDIR /app RUN git clone --depth 1 https://github.com/thiagoesteves/observer_web.git . RUN mix local.hex --force && mix local.rebar --force && mix deps.get && mix deps.compile COPY docker/observer_web/build-assets.config.exs config/build-assets.config.exs RUN printf '\nimport_config "build-assets.config.exs"\n' >> config/config.exs RUN mkdir -p priv/static && \ touch priv/static/app.css && touch priv/static/app.js && \ cd assets && \ npm install && \ npm install --save-dev tailwindcss@4.1.0 @tailwindcss/cli @tailwindcss/forms esbuild@0.17.11 && \ cd .. && \ mix assets.build && \ rm -rf assets/node_modules /root/.npm /root/.cache .git FROM erlang:28-alpine AS runtime RUN for i in 1 2 3 4 5; do \ apk add --no-cache elixir inotify-tools && break; \ echo "apk retry $i/5..."; sleep 15; \ done RUN mix local.hex --force && mix local.rebar --force WORKDIR /app COPY --from=builder /app /app COPY docker/observer_web/dev.exs ./dev.exs EXPOSE 4000 ENV RELEASE_COOKIE=eventhub_cookie CMD elixir --sname observer_web@observer_web --cookie "${RELEASE_COOKIE}" -S mix run --no-halt dev.exs