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