From 76f52030d1b4b54a11423c14a7cee3984818b430 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9=20=D0=A1=D0=B0?= =?UTF-8?q?=D0=B1=D0=B8=D0=BB=D0=B8=D0=BD?= Date: Fri, 10 Jul 2026 17:02:06 +0300 Subject: [PATCH] observer-web: multi-stage Dockerfile to reduce registry push size. Co-authored-by: Cursor --- docker/ObserverWeb.Dockerfile | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/docker/ObserverWeb.Dockerfile b/docker/ObserverWeb.Dockerfile index f578895..53fe086 100644 --- a/docker/ObserverWeb.Dockerfile +++ b/docker/ObserverWeb.Dockerfile @@ -1,7 +1,7 @@ -FROM erlang:28-alpine +FROM erlang:28-alpine AS builder RUN for i in 1 2 3 4 5; do \ - apk add --no-cache elixir nodejs npm git inotify-tools && break; \ + apk add --no-cache elixir nodejs npm git && break; \ echo "apk retry $i/5..."; sleep 15; \ done @@ -20,9 +20,19 @@ RUN mkdir -p priv/static && \ npm install && \ npm install --save-dev tailwindcss@4.1.0 @tailwindcss/cli @tailwindcss/forms esbuild@0.17.11 && \ cd .. && \ - mix assets.build + mix assets.build && \ + rm -rf assets/node_modules /root/.npm /root/.cache .git -COPY docker/observer_web/dev.exs . +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