Compare commits

..

1 Commits

Author SHA1 Message Date
Jarvis
c7d0663de6 feat(deploy): portainer stack template for federation test instances [FED-M2-DEPLOY-02]
All checks were successful
ci/woodpecker/pr/ci Pipeline was successful
ci/woodpecker/push/ci Pipeline was successful
Add deploy/portainer/federated-test.stack.yml — a Docker Swarm-compatible
Compose file for Portainer that boots a federated-tier gateway (gateway +
pgvector/pg17 + valkey:8-alpine) with Traefik HTTPS labels and digest-pinned
image (fed-v0.1.0-m1). Parameterised via STACK_NAME/HOST_FQDN for reuse
across mos-test-1 and mos-test-2 in DEPLOY-03/04. Add deploy/portainer/README.md
with deployment instructions, required env vars, and external resource notes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-21 20:28:21 -05:00

View File

@@ -5,27 +5,18 @@ RUN corepack enable
FROM base AS builder FROM base AS builder
WORKDIR /app WORKDIR /app
# Copy workspace manifests first for layer-cached install
COPY pnpm-workspace.yaml pnpm-lock.yaml package.json ./ COPY pnpm-workspace.yaml pnpm-lock.yaml package.json ./
COPY apps/gateway/package.json ./apps/gateway/ COPY apps/gateway/package.json ./apps/gateway/
COPY packages/ ./packages/ COPY packages/ ./packages/
COPY plugins/ ./plugins/
RUN pnpm install --frozen-lockfile RUN pnpm install --frozen-lockfile
COPY . . COPY . .
# Build gateway and all of its workspace dependencies via turbo dependency graph RUN pnpm --filter @mosaic/gateway build
RUN pnpm turbo run build --filter @mosaicstack/gateway...
# Produce a self-contained deploy artifact: flat node_modules, no pnpm symlinks
# --legacy is required for pnpm v10 when inject-workspace-packages is not set
RUN pnpm --filter @mosaicstack/gateway --prod deploy --legacy /deploy
FROM base AS runner FROM base AS runner
WORKDIR /app WORKDIR /app
ENV NODE_ENV=production ENV NODE_ENV=production
# Use the pnpm deploy output — resolves all deps into a flat, self-contained node_modules
COPY --from=builder /deploy/node_modules ./node_modules
COPY --from=builder /deploy/package.json ./package.json
# dist is declared in package.json "files" so pnpm deploy copies it into /deploy;
# copy from builder explicitly as belt-and-suspenders
COPY --from=builder /app/apps/gateway/dist ./dist COPY --from=builder /app/apps/gateway/dist ./dist
COPY --from=builder /app/apps/gateway/package.json ./package.json
COPY --from=builder /app/node_modules ./node_modules
EXPOSE 4000 EXPOSE 4000
CMD ["node", "dist/main.js"] CMD ["node", "dist/main.js"]