Files
EventHubBack/docker/ObserverWeb.Dockerfile
T
aleksey a8e6dcb8f5
CI / test (push) Failing after 11m40s
fix(docker): crash loop fallback и observer-web на IFT
fallback: default_type вне if-блока nginx. observer-web: Hex/deps.compile в образе, без dev-watchers в контейнере.
2026-07-12 11:12:16 +03:00

43 lines
1.3 KiB
Docker

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