deploy: Dockerfile + nginx + Gitea Actions build
build-and-publish / test (push) Has been cancelled
build-and-publish / image (push) Has been cancelled

Two-stage build (node:22 → nginx:1.27) bakes dist/ into a static image.
nginx reverse-proxies /api/* to demo.flow-master.ai so live mode works
same-origin without CORS. CI runs vitest + build, then publishes
gitea.flow-master.ai/shad/mission-control-demo:sha-${git} on push to main.

Constraint: backend rejects cross-origin → same-origin proxy required
Confidence: high
Scope-risk: narrow
Not-tested: image actually built in Gitea Actions (requires registry secret)
This commit is contained in:
2026-06-14 00:10:56 +04:00
parent 3ffd0e68a7
commit 2b83e3ad0e
3 changed files with 98 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
# Two-stage build: vite static build → nginx serving dist/.
# Image is intended to be pushed to gitea.flow-master.ai/shad/mission-control-demo
# and referenced from FM06/flowmaster-ops manifests/overlays/demo/mc-deployment.yaml.
FROM node:22-alpine AS build
WORKDIR /app
COPY package.json pnpm-lock.yaml ./
RUN corepack enable && corepack prepare pnpm@latest --activate \
&& pnpm install --frozen-lockfile
COPY . .
RUN pnpm build
FROM nginx:1.27-alpine
COPY --from=build /app/dist/ /usr/share/nginx/html/
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
HEALTHCHECK --interval=30s --timeout=3s --start-period=10s \
CMD wget -q --spider http://127.0.0.1/ || exit 1