Add Dockerfile and compose file for web platform build.
Description
Add Dockerfile and compose file for web platform build.
Additional Notes
Screenshots
Contributor Agreement
By submitting this Pull Request, I confirm that I have read and agree to the following terms:
- I agree to contribute all code submitted in this PR to the open-source community edition licensed under GPLv3 and the proprietary official edition without compensation.
- I grant the official edition development team the rights to freely use, modify, and distribute this code, including for commercial purposes.
- I confirm that this code is my original work, or I have obtained the appropriate authorization from the copyright holder to submit this code under these terms.
- I understand that the submitted code will be publicly released under the GPLv3 license, and may also be used in the proprietary official edition.
Please check the box below to confirm:
[ x ] I have read and agree with the above statement.
Summary by CodeRabbit
-
New Features
- Added official Docker support to run the web app in a containerized environment.
- Provided a Docker Compose setup for one-command startup and data persistence via a mounted volume.
- Optimized production serving via a lightweight web server for improved deployment reliability.
-
Chores
- Introduced an automated CI workflow to build and publish the Docker image on pushes and pull requests.
[!IMPORTANT]
Review skipped
Auto reviews are disabled on this repository.
Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.
Walkthrough
Adds containerization and CI/CD: a multi-stage Dockerfile to build a web renderer and serve via Nginx, a docker-compose.yml to run the app locally, and a GitHub Actions workflow to build and push the Docker image to Docker Hub on pushes/PRs to main.
Changes
| Cohort / File(s) | Summary of Changes |
|---|---|
CI/CD Workflow.github/workflows/docker-publish.yml |
New workflow “Docker Image CI” triggered on push/PR to main; checks out code, logs into Docker Hub via secrets, builds and pushes image using docker/build-push-action@v5 to highkay/chatbox-web:latest. |
Container Image BuildDockerfile |
New multi-stage Dockerfile: Node 22-alpine base, install deps from npmmirror, build with npm run build:web, final stage on nginx:alpine serving artifacts from /app/release/app/dist/renderer at port 80. |
Local Orchestrationdocker-compose.yml |
New Compose v3.8 file with service “chatbox” built from current dir, port mapping 3000:3000, and volume ./data to /root/.config/xyz.chatboxapp.ce. |
Sequence Diagram(s)
sequenceDiagram
participant Dev
participant GitHub
participant Actions as GitHub Actions
participant DockerHub
Dev->>GitHub: Push/PR to main
GitHub-->>Actions: Trigger workflow
Actions->>Actions: Checkout repository
Actions->>DockerHub: Login with secrets
Actions->>DockerHub: Build & push image (highkay/chatbox-web:latest)
sequenceDiagram
participant User
participant DockerCompose
participant Container
participant Nginx
User->>DockerCompose: docker-compose up
DockerCompose->>Container: Build image from Dockerfile
Container->>Nginx: Start nginx serving /usr/share/nginx/html
User->>Nginx: HTTP GET /
Nginx-->>User: Serve built static assets
Estimated code review effort
🎯 2 (Simple) | ⏱️ ~8 minutes
Poem
Hop hop! I baked a shiny ship,
Docker clouds for every trip.
Actions push it, swift and clean,
Nginx hums with static sheen.
Compose says “up!”—ports align,
A warren of bits, deployed just fine.
Carrots for logs; all green! 🥕🚀
✨ Finishing touches
🧪 Generate unit tests (beta)
- [ ] Create PR with unit tests
- [ ] Post copyable unit tests in a comment
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands and usage tips.
@coderabbitai review
✅ Actions performed
Review triggered.
Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.