observer-web: multi-stage Dockerfile to reduce registry push size.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
FROM erlang:28-alpine
|
FROM erlang:28-alpine AS builder
|
||||||
|
|
||||||
RUN for i in 1 2 3 4 5; do \
|
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; \
|
echo "apk retry $i/5..."; sleep 15; \
|
||||||
done
|
done
|
||||||
|
|
||||||
@@ -20,9 +20,19 @@ RUN mkdir -p priv/static && \
|
|||||||
npm install && \
|
npm install && \
|
||||||
npm install --save-dev tailwindcss@4.1.0 @tailwindcss/cli @tailwindcss/forms esbuild@0.17.11 && \
|
npm install --save-dev tailwindcss@4.1.0 @tailwindcss/cli @tailwindcss/forms esbuild@0.17.11 && \
|
||||||
cd .. && \
|
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
|
EXPOSE 4000
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user