mirror of
https://github.com/jhd3197/ServerKit.git
synced 2026-11-09 05:24:49 +09:00
Deploying checked three things — the name is free, the server row exists, the directory isn't taken. Nothing asked whether the box could carry the thing, so a 2 GB app landed on a 1 GB VPS at full speed and the first sign of trouble was the OOM killer. Every piece was already here and unconnected: templates describe what they cost (`requirements: memory / storage`), servers report what they have (Server.total_memory / total_disk) and what they are using (the newest ServerMetrics sample). This is the join, answering in the shape a person asks it — does it fit, will it be tight, or can't we tell? Advisory on purpose. It reports; it never refuses. An estimate is an estimate, real usage depends on configuration and traffic, so the operator keeps the final say and "tight" is a sentence to read rather than a wall to argue with. A full server still returns valid:true, and a test asserts that so this cannot quietly become a gate. Three judgements worth stating: - The reserve is a floor-and-fraction pair (10% of the box, at least 256 MB RAM / 2 GB disk). A bare percentage is wrong at both ends: 10% of 1 GB is nothing, 10% of 64 GB is more than most apps need. - `unknown` outranks `ok`. No recent sample, or a template that declares nothing, says so — a confident wrong answer is worse than no answer. - Free memory comes from psutil's `available`, not `free`: cache and buffers are reclaimable, and counting them as used calls every healthy Linux box full. Catalog coverage goes from 52/106 to 106/106. The 54 estimates are each app's typical idle-to-light-use footprint, taken from the project's own documented minimum where it publishes one and rounded to the values the existing 52 already use — sonarqube 4 GB because that is its documented heap floor, immich 4 GB for the ML models, prometheus 20 GB because retention dominates, traefik 256 MB. Surfaced two ways: a capacity block alongside (never inside) `errors` on validate-install, and a read-only GET the deploy drawer can poll while the operator is still choosing a target, so the answer updates as they switch servers instead of waiting for a submit. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
91 lines
2.0 KiB
YAML
91 lines
2.0 KiB
YAML
id: wordpress
|
|
name: WordPress
|
|
version: "6.4"
|
|
description: World's most popular content management system for blogs and websites
|
|
icon: https://serverkit.ai/imgs/template-icons/wordpress.png
|
|
website: https://wordpress.org
|
|
documentation: https://wordpress.org/documentation/
|
|
categories:
|
|
- cms
|
|
- blog
|
|
- website
|
|
|
|
variables:
|
|
- name: VERSION
|
|
description: WordPress image tag (WP core + PHP variant, e.g. 6.4-php8.2-apache)
|
|
type: string
|
|
default: "6.4-apache"
|
|
hidden: true
|
|
- name: HTTP_PORT
|
|
description: HTTP port
|
|
type: port
|
|
default: "8300"
|
|
hidden: true
|
|
- name: DB_PASSWORD
|
|
description: MySQL root password
|
|
type: password
|
|
generate: password
|
|
hidden: true
|
|
- name: WP_DB_PASSWORD
|
|
description: WordPress database password
|
|
type: password
|
|
generate: password
|
|
hidden: true
|
|
|
|
ports:
|
|
- port: 8080
|
|
protocol: tcp
|
|
description: Web interface
|
|
|
|
volumes:
|
|
- name: html
|
|
path: /var/www/html
|
|
description: WordPress files
|
|
- name: db
|
|
path: /var/lib/mysql
|
|
description: MySQL data
|
|
|
|
requirements:
|
|
memory: 1GB
|
|
storage: 5GB
|
|
|
|
compose:
|
|
services:
|
|
wordpress:
|
|
image: wordpress:${VERSION}
|
|
container_name: ${APP_NAME}
|
|
restart: unless-stopped
|
|
environment:
|
|
- WORDPRESS_DB_HOST=db
|
|
- WORDPRESS_DB_USER=wordpress
|
|
- WORDPRESS_DB_PASSWORD=${WP_DB_PASSWORD}
|
|
- WORDPRESS_DB_NAME=wordpress
|
|
volumes:
|
|
- wordpress_html:/var/www/html
|
|
ports:
|
|
- "${HTTP_PORT}:80"
|
|
depends_on:
|
|
- db
|
|
- redis
|
|
|
|
redis:
|
|
image: redis:7-alpine
|
|
container_name: ${APP_NAME}-redis
|
|
restart: unless-stopped
|
|
|
|
db:
|
|
image: mysql:8.0
|
|
container_name: ${APP_NAME}-db
|
|
restart: unless-stopped
|
|
environment:
|
|
- MYSQL_ROOT_PASSWORD=${DB_PASSWORD}
|
|
- MYSQL_DATABASE=wordpress
|
|
- MYSQL_USER=wordpress
|
|
- MYSQL_PASSWORD=${WP_DB_PASSWORD}
|
|
volumes:
|
|
- wordpress_db:/var/lib/mysql
|
|
|
|
volumes:
|
|
wordpress_html:
|
|
wordpress_db:
|