ci / rust (push) Successful in 1m13s
NAP-218. Add a node:20 stage to the registry Dockerfile that runs `pnpm install && pnpm build` against `web/`, then copies the resulting `dist/` into the Rust builder so rust-embed picks it up. Single-binary deploy still — no separate static-asset volume. `.dockerignore` keeps `web/node_modules` and `web/dist` out of the build context (the node stage produces them fresh) while letting the sources through. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
45 lines
1.6 KiB
Docker
45 lines
1.6 KiB
Docker
# syntax=docker/dockerfile:1.7
|
|
#
|
|
# Image for the `maestro-registry` binary.
|
|
#
|
|
# Build: docker build -t maestro-registry .
|
|
# Run: docker run --rm -p 8080:8080 -e MAESTRO_TOKEN=<secret> maestro-registry
|
|
#
|
|
# On Dokploy: point at this Dockerfile, expose port 8080 (or whatever you
|
|
# set MAESTRO_REGISTRY_BIND_ADDR to), and set MAESTRO_TOKEN as a secret env.
|
|
# No persistent volume is required when MAESTRO_TOKEN is provided.
|
|
|
|
# 1. Build the web client bundle. Output lands in /web/dist and is consumed
|
|
# by the Rust builder below via `rust-embed`.
|
|
FROM node:20-bookworm AS web-builder
|
|
WORKDIR /web
|
|
RUN corepack enable
|
|
COPY web/package.json web/pnpm-lock.yaml* ./
|
|
RUN pnpm install --frozen-lockfile || pnpm install
|
|
COPY web/ ./
|
|
RUN pnpm build
|
|
|
|
# 2. Build the registry binary. `rust-embed` picks up the bundle that the
|
|
# previous stage produced.
|
|
FROM rust:1-bookworm AS builder
|
|
WORKDIR /build
|
|
COPY . .
|
|
COPY --from=web-builder /web/dist /build/web/dist
|
|
RUN --mount=type=cache,target=/usr/local/cargo/registry \
|
|
--mount=type=cache,target=/build/target \
|
|
cargo build --release -p maestro-registry \
|
|
&& cp /build/target/release/maestro-registry /maestro-registry
|
|
|
|
FROM debian:bookworm-slim
|
|
RUN apt-get update \
|
|
&& apt-get install -y --no-install-recommends ca-certificates \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
COPY --from=builder /maestro-registry /usr/local/bin/maestro-registry
|
|
|
|
# Default to all-interfaces so Dokploy / Traefik can reach the service.
|
|
# Override via env on the platform.
|
|
ENV MAESTRO_REGISTRY_BIND_ADDR=0.0.0.0:8080
|
|
EXPOSE 8080
|
|
|
|
ENTRYPOINT ["/usr/local/bin/maestro-registry"]
|