Files
EventHubBack/docker/ObserverWeb.Dockerfile
T
aleksey 9886dff8bf
CI / test (push) Successful in 6m13s
CI / deploy-ift (push) Successful in 4m46s
CI / e2e-ift (push) Successful in 1m25s
CI / deploy-stage (push) Successful in 1m57s
CI / e2e-stage (push) Successful in 1m11s
fix: run observer_web as hidden node to stop OTP global splitting IFT Mnesia cluster.
Without --hidden, observer joins the visible mesh and prevent_overlapping_partitions disconnects eventhub-node1/2 (running_partitioned_network → admin verification-token 404 in e2e).
2026-07-21 22:14:16 +03:00

46 lines
1.5 KiB
Docker
Executable File

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
# --hidden: observer must not join the visible global mesh. Without it, OTP
# prevent_overlapping_partitions disconnects eventhub-node1 <-> eventhub-node2
# when observer connects to both (Mnesia running_partitioned_network → e2e 404).
CMD elixir --hidden --sname observer_web@observer_web --cookie "${RELEASE_COOKIE}" -S mix run --no-halt dev.exs