Run YunCMS with Docker Compose: MySQL 8.4 Included
说明与用途
通过 Docker Compose,YunCMS 可以快速部署,包含 MySQL 8.4、所有必需服务和持久化卷。流程包括下载 compose 文件、配置环境变量、初始化数据库、启动容器,并通过 /health 和 /ready 端点验证就绪状态。
问题
Setting up YunCMS locally or in production requires coordinating Node.js, npm, and a separate MySQL server, which is cumbersome for quick evaluation.
结果
The workflow delivers a reproducible, self‑contained YunCMS environment with persistent MySQL and CMS data, simplifying local evaluation and production deployment.
工作流
- Create deployment directory and download compose files
- Edit .env with strong passwords and pin image version
- Start MySQL container and wait for healthy status
- Run
docker compose run --rm yuncms initto create schema and admin account - Start YunCMS container and verify
/healthand/readyendpoints - Use
docker compose downto stop services without deleting data - Create backups with
docker compose run --rm yuncms backup - Update image by changing YUNCMS_IMAGE, pulling new image, running
bootstrap, and restarting - Configure reverse proxy, TLS, and production settings before exposing to internet
证据
The YunCMS image also includes the MySQL client tools required by the backup and restore commands.
Stop the service and create a verified backup with the current image.
The stack does not consider YunCMS ready before MySQL becomes healthy.
- 记录日期: 2026-09-17T20:45:31.986Z