[PR #25] [MERGED] Containerize the full stack and fix repo references #25

Closed
opened 2026-03-02 11:44:10 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/jhd3197/ServerKit/pull/25
Author: @jhd3197
Created: 3/1/2026
Status: Merged
Merged: 3/1/2026
Merged by: @jhd3197

Base: mainHead: dev


📝 Commits (7)

  • 580a95c Use window.location.origin for install scripts
  • f0eb8b8 Update GitHub repo references and install params
  • 96f148f chore: bump version to 1.2.89 [skip ci]
  • 54e6e02 Bump Flask and Werkzeug versions
  • d588dee chore: bump version to 1.2.90 [skip ci]
  • 8921b6f Compose: containerize backend & build frontend
  • b055470 chore: bump version to 1.2.91 [skip ci]

📊 Changes

18 files changed (+111 additions, -130 deletions)

View changed files

📝 VERSION (+1 -1)
📝 agent/Dockerfile (+1 -1)
📝 agent/README.md (+2 -2)
📝 agent/packaging/deb/build.sh (+2 -2)
📝 agent/packaging/rpm/build.sh (+2 -2)
backend/.dockerignore (+9 -0)
📝 backend/app/__init__.py (+9 -4)
📝 backend/app/api/servers.py (+4 -2)
📝 backend/requirements.txt (+2 -2)
docker-compose.dev.yml (+0 -69)
📝 docker-compose.yml (+48 -18)
📝 frontend/.dockerignore (+0 -6)
📝 frontend/Dockerfile (+16 -4)
📝 frontend/nginx.conf (+2 -2)
📝 frontend/src/pages/Servers.jsx (+4 -4)
📝 scripts/dev/dev.bat (+7 -9)
📝 scripts/install.ps1 (+1 -1)
📝 scripts/install.sh (+1 -1)

📄 Description

The backend was the one service that refused to live in a container — it ran on the host while everything else sat in Docker, connected by host.docker.internal and good intentions. This PR gives it a proper home. Both services now run in a single docker-compose.yml with a multi-stage frontend build, and all the old placeholder URLs and ghost repo references (serverkit/serverkit) have been exorcised.

Technical changes
  • Docker Compose unified: Removed docker-compose.dev.yml entirely. docker-compose.yml now runs both backend and frontend with health checks, log rotation, and named volumes. Backend exposed on :5849, frontend on :3847.
  • Backend containerized: Added backend/.dockerignore. Backend container uses SQLite at /app/instance/serverkit.db with volume mounts for data and config persistence.
  • Frontend Dockerfile rewritten: Changed from copying pre-built dist/ to a multi-stage build (node:20-alpine builds, nginx:alpine serves). Updated .dockerignore to stop excluding source files needed for the in-container build.
  • Nginx proxy targets: frontend/nginx.conf now routes /api and /socket.io to backend:5000 (Docker service name) instead of host.docker.internal:5000.
  • Graceful missing-frontend handling in backend/app/__init__.py: The / route and 404 handler now check whether index.html exists before attempting to serve it. When the backend runs standalone (no frontend assets), it returns a JSON response instead of crashing.
  • GitHub repo references: Updated from serverkit/serverkit to jhd3197/ServerKit in agent/Dockerfile, agent/README.md, agent/packaging/deb/build.sh, agent/packaging/rpm/build.sh, scripts/install.sh, and scripts/install.ps1.
  • Install script URL generation: backend/app/api/servers.py now replaces the GITHUB_REPO placeholder in addition to the server URL when serving install scripts. frontend/src/pages/Servers.jsx uses window.location.origin for the curl/irm download URL instead of the hardcoded https://your-server placeholder, and aligns parameter names (--server instead of --server-url, -Server instead of -ServerUrl).
  • Dependency bumps: Flask 3.0.0 -> 3.1.3, Werkzeug 3.1.5 -> 3.1.6.
  • scripts/dev/dev.bat: Simplified to use the single docker-compose.yml, updated port references to match new mapping.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/jhd3197/ServerKit/pull/25 **Author:** [@jhd3197](https://github.com/jhd3197) **Created:** 3/1/2026 **Status:** ✅ Merged **Merged:** 3/1/2026 **Merged by:** [@jhd3197](https://github.com/jhd3197) **Base:** `main` ← **Head:** `dev` --- ### 📝 Commits (7) - [`580a95c`](https://github.com/jhd3197/ServerKit/commit/580a95c7bb65f38e1d60cc7f9e7bdbc42bf2aec3) Use window.location.origin for install scripts - [`f0eb8b8`](https://github.com/jhd3197/ServerKit/commit/f0eb8b8cd9e859060b20f104ebc29ae889fef9d1) Update GitHub repo references and install params - [`96f148f`](https://github.com/jhd3197/ServerKit/commit/96f148f0837e394d02ce2811e805c7233422061d) chore: bump version to 1.2.89 [skip ci] - [`54e6e02`](https://github.com/jhd3197/ServerKit/commit/54e6e023a203b4fbf59c46bffdd23dc76cbf1919) Bump Flask and Werkzeug versions - [`d588dee`](https://github.com/jhd3197/ServerKit/commit/d588dee7c243dc186b0797ce4fcb11fb92da9764) chore: bump version to 1.2.90 [skip ci] - [`8921b6f`](https://github.com/jhd3197/ServerKit/commit/8921b6ff0a4c2d9340ab5c0ef6f97d555b8a7404) Compose: containerize backend & build frontend - [`b055470`](https://github.com/jhd3197/ServerKit/commit/b055470bf355e3ae18a70daa6e49c0417abcc876) chore: bump version to 1.2.91 [skip ci] ### 📊 Changes **18 files changed** (+111 additions, -130 deletions) <details> <summary>View changed files</summary> 📝 `VERSION` (+1 -1) 📝 `agent/Dockerfile` (+1 -1) 📝 `agent/README.md` (+2 -2) 📝 `agent/packaging/deb/build.sh` (+2 -2) 📝 `agent/packaging/rpm/build.sh` (+2 -2) ➕ `backend/.dockerignore` (+9 -0) 📝 `backend/app/__init__.py` (+9 -4) 📝 `backend/app/api/servers.py` (+4 -2) 📝 `backend/requirements.txt` (+2 -2) ➖ `docker-compose.dev.yml` (+0 -69) 📝 `docker-compose.yml` (+48 -18) 📝 `frontend/.dockerignore` (+0 -6) 📝 `frontend/Dockerfile` (+16 -4) 📝 `frontend/nginx.conf` (+2 -2) 📝 `frontend/src/pages/Servers.jsx` (+4 -4) 📝 `scripts/dev/dev.bat` (+7 -9) 📝 `scripts/install.ps1` (+1 -1) 📝 `scripts/install.sh` (+1 -1) </details> ### 📄 Description The backend was the one service that refused to live in a container — it ran on the host while everything else sat in Docker, connected by `host.docker.internal` and good intentions. This PR gives it a proper home. Both services now run in a single `docker-compose.yml` with a multi-stage frontend build, and all the old placeholder URLs and ghost repo references (`serverkit/serverkit`) have been exorcised. <details> <summary>Technical changes</summary> - **Docker Compose unified**: Removed `docker-compose.dev.yml` entirely. `docker-compose.yml` now runs both backend and frontend with health checks, log rotation, and named volumes. Backend exposed on `:5849`, frontend on `:3847`. - **Backend containerized**: Added `backend/.dockerignore`. Backend container uses SQLite at `/app/instance/serverkit.db` with volume mounts for data and config persistence. - **Frontend Dockerfile rewritten**: Changed from copying pre-built `dist/` to a multi-stage build (`node:20-alpine` builds, `nginx:alpine` serves). Updated `.dockerignore` to stop excluding source files needed for the in-container build. - **Nginx proxy targets**: `frontend/nginx.conf` now routes `/api` and `/socket.io` to `backend:5000` (Docker service name) instead of `host.docker.internal:5000`. - **Graceful missing-frontend handling** in `backend/app/__init__.py`: The `/` route and 404 handler now check whether `index.html` exists before attempting to serve it. When the backend runs standalone (no frontend assets), it returns a JSON response instead of crashing. - **GitHub repo references**: Updated from `serverkit/serverkit` to `jhd3197/ServerKit` in `agent/Dockerfile`, `agent/README.md`, `agent/packaging/deb/build.sh`, `agent/packaging/rpm/build.sh`, `scripts/install.sh`, and `scripts/install.ps1`. - **Install script URL generation**: `backend/app/api/servers.py` now replaces the `GITHUB_REPO` placeholder in addition to the server URL when serving install scripts. `frontend/src/pages/Servers.jsx` uses `window.location.origin` for the `curl`/`irm` download URL instead of the hardcoded `https://your-server` placeholder, and aligns parameter names (`--server` instead of `--server-url`, `-Server` instead of `-ServerUrl`). - **Dependency bumps**: Flask `3.0.0` -> `3.1.3`, Werkzeug `3.1.5` -> `3.1.6`. - **`scripts/dev/dev.bat`**: Simplified to use the single `docker-compose.yml`, updated port references to match new mapping. </details> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-02 11:44:10 +03:00
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ServerKit#25
No description provided.