add multi-stage Dockerfile with nginx for production deployment#3
Open
thuantan2060 wants to merge 6 commits intoNevaMind-AI:mainfrom
Open
add multi-stage Dockerfile with nginx for production deployment#3thuantan2060 wants to merge 6 commits intoNevaMind-AI:mainfrom
thuantan2060 wants to merge 6 commits intoNevaMind-AI:mainfrom
Conversation
- Stage 1: Node 22-alpine builds Vite/React app - Stage 2: nginx-alpine serves static files - nginx.conf proxies /api/* to memu-server:8000 - SPA fallback for client-side routing - Static asset caching (1 year, immutable) - .dockerignore excludes node_modules, dist, .git Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Build and push memu-ui Docker image to ghcr.io/parasite2060/memu-ui on push to main and version tags. Uses existing multi-stage Dockerfile (node:22-alpine + nginx:alpine).
- actions/checkout v4 → v6 - docker/setup-buildx-action v3 → v4 - docker/login-action v3 → v4 - docker/metadata-action v5 → v6 - docker/build-push-action v6 → v7
Replace docker.yml with release.yml that uses release-please for version management. Docker images tagged with semver on release.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 Pull Request Summary
Add a production-ready Docker setup using multi-stage build (Node.js build → nginx serve) with API reverse proxy
configuration for the memU server backend.
✅ What does this PR do?
Dockerfilewith multi-stage build:node:22-alpineinstalls dependencies and runsnpm run buildto produce optimizedstatic assets via Vite
nginx:alpineserves the built files (~25MB final image vs ~1GB with node_modules)nginx.confwith:/api/*requests forwarded tomemu-server:8000(Docker network), rewriting the/apiprefix — matches the Vite dev proxy behavior
try_files $uri $uri/ /index.htmlfor client-side routing.dockerignoreto excludenode_modules,dist,.gitfrom build context🤔 Why is this change needed?
npm run devwith Vite's built-in proxydocker compose upwith a single command/api→ backend), so the React app worksidentically in both environments without code changes
🔍 Type of Change
Please check what applies:
✅ PR Quality Checklist
📌 Optional
index.htmlso React Router works/apiprefix to match backend routes (/api/retrieve→/retrieve)memu-serverhostname via Docker Compose service discoveryVITE_API_BASE_URLbuild arg for custom API endpoints in non-Docker deployments