Dockerfile and docker-compose.yml that orchestrate the CMS server, MySQL 8, and Redis 7 as a single multi-container application. This is the fastest path to a reproducible, isolated deployment — all service dependencies are declared in one file, and a single command brings the entire stack online. If you’re running on a container-friendly host or already use Docker in your workflow, this is the recommended deployment path.
Make sure Docker Engine and the Docker Compose plugin are installed on your server before proceeding.
# Install Docker Engine
curl -fsSL https://get.docker.com | sh
# Verify installation
docker --version
docker compose version
You’ll need Docker Engine 20.10+ and Docker Compose v2.0+. Refer to the official Docker installation docs for other operating systems.
Open
server/.env and set your database credentials, JWT secret, Redis connection, and server host. Pay particular attention to:DATABASE_PASSWORD — set a strong password; this value must match what MySQL initializes withJWT_SECRET — generate a random 32+ character string (see the Environment guide)SERVER_HOST and IMG_HOST — set to your public domainSee the full Environment Variables guide for a description of every variable.
Dockerfile-d = detached mode)On first run, you need to import the initial database schema and seed data into the MySQL container. The project includes a SQL file for this purpose.
# Import the initial SQL dump
docker compose exec mysql mysql \
-u root \
-p"${DATABASE_PASSWORD}" \
node_forge_cms < server/sql/init.sql
Replace
server/sql/init.sql with the actual path to your SQL file if it differs. You only need to run this once — on subsequent restarts, MySQL will read from its persisted volume.MySQL data is persisted using a named Docker volume, so your database survives container restarts and image updates. To inspect or back up the volume:Do not use
docker compose down -v in production — the -v flag removes volumes and will permanently delete your database.The admin panel is a static Vue application that must be compiled and placed where Nginx (or your reverse proxy) can serve it. The build command depends on your domain topology:
Separate Domains
admin/dist/. Point your reverse proxy for admin.yourdomain.com at this directory. Shared Domain
/admin. Output is written to admin/dist/.Once all services are running, the database is imported, and the admin panel is built, your NodeForgeCMS instance is live. Open your configured
SERVER_HOST in a browser to see the public site, and navigate to /admin (or admin.yourdomain.com for separate-domain deployments) to access the admin panel.Automated Deployment with deploy.sh
The project includes a deploy.sh script that automates the full build-and-restart cycle — useful for deploying updates without manual steps:
Useful Docker Compose Commands
| Task | Command |
|---|---|
| Start all services | docker compose up -d |
| Stop all services | docker compose down |
| Restart all services | docker compose restart |
| Restart a single service | docker compose restart app |
| Stream live logs (all services) | docker compose logs -f |
| Stream logs for one service | docker compose logs -f app |
| Rebuild and restart | docker compose up -d --build |
| Open a shell in the app container | docker compose exec app sh |