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