Files
EventHubBack/docker/ObserverWeb.Dockerfile
T
aleksey 76f52030d1
CI / test (push) Successful in 15m23s
Deploy stage (core) / deploy-stage-core (push) Failing after 2m58s
observer-web: multi-stage Dockerfile to reduce registry push size.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-10 17:02:06 +03:00

40 lines
1.2 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
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
WORKDIR /app
COPY --from=builder /app /app
COPY docker/observer_web/dev.exs ./dev.exs
EXPOSE 4000
CMD elixir --sname observer_web@observer_web --cookie eventhub_cookie -S mix run --no-halt dev.exs