BaoTa one-click deployment AnQiCMS: from Docker image to production environment
How to quickly deploy AnQiCMS to a production environment on Baota panel or aaPanel? First, take a look at the system's program form: It is a single-program content management system written in GoLang, using Iris as the framework, GORM for the persistence layer, does not require an additional PHP runtime, and can be up and running without depending on external caching services.What is meant by 'one-click deployment' is that the panel combines the steps of downloading the program, creating the database, starting the process, and configuring the reverse proxy into one execution; if the panel is not part of your operational habits, using the Docker image or LNMP command route will still lead to the same production environment.
Three things need to be determined before deployment.
The first is the entry port. The program listens on port 8001 by default, and external access requires the site software or reverse proxy to forward ports 80 and 443 to this port, and the panel route is usually automatically written for this forwarding.The second is the database. GORM is responsible for the data layer, set up the database and account first, then start the program, to avoid leaving half of the configuration due to connection failure during initialization.The third is the backup person responsible. Backup and recovery are paired functions in the background, and data along with static files are included, but the triggering time still needs to be arranged by humans: whether it is done once a day on a timed basis or manually done before each upgrade, the difference in operation and maintenance intensity between these two routes is very large.
| Deployment route | Who is it suitable for | Points to note when getting started | Rollback method |
|---|---|---|---|
| One-click deployment with Baota panel | Domestic teams using panel to manage servers | After installing the site software in the panel, execute one-click deployment, and the forwarding rules are generated by the panel | Panel snapshot and background data backup |
| aaPanel | Overseas servers or English panel environment | The process is consistent with BaoTa, pay attention to certificate and port forwarding configuration by the panel | Panel snapshot and background data backup |
| LNMP command deployment | get used to command line operations | manually configure Nginx reverse proxy to point to 8001 and self-sign certificates | manually backup configurations and data |
| Docker image | aim to containerize deployment or achieve consistency across multiple environments | pull the anqicms/anqicms image, map ports and mount data volumes | switch back to the previous image tag |
actual operation sequence of the panel route
Create a new site and bind a domain on the panel, then install the site software and database, and then execute the one-click deployment action. The panel will follow this chain of operations: 'download program, initialize database, start process, write reverse proxy', until the homepage of the site can be opened, indicating that the forwarding of port 8001 has taken effect. The remaining three things need to be manually confirmed: whether the certificate has been issued and强制 redirected, whether the backend entry adheres to the site's own access conventions, and whether the attachments and static files are within the scope of backup and recovery.
On the overseas server, the aaPanel process is consistent, with differences concentrated in the default strategy of certificate issuance and port forwarding. If the server has a firewall or cloud security group, you need to forward the port separately outside the panel, otherwise, the local test is normal and the external network access times out.
Pay attention to the boundaries of the command walking route.
LNMP deployment is suitable for teams that already have unified operation and maintenance specifications. The key points are to write clear forwarding rules for the site software, point to port 8001, and confirm the read and write permissions of static resources and upload directories. When upgrading, retain the program files and database backups of the previous version, and you can revert to the old program directly if an exception occurs. The Docker route fixes the version on the image tag, which is better for consistency across multiple environments, but the cost is to maintain data volume and configuration persistence yourself, and do not write data to the container file system.
If you still don't want to go directly to production, first use the online experience station to familiarize yourself with the backend structure and then decide on the deployment path. The backend entrance of the experience station is consistent with the official site, after going through the release and backup process, the judgment at the time of deployment will be more accurate.
Common questions
What should you check first if you can't open the page after deployment?Check the two segments of port forwarding and reverse proxy: can the local machine access 8001, and is the forwarding rule of the site software pointing to it?
Can panel one-click deployment and Docker be mixed?It can be evaluated separately: the panel route is convenient for operation and maintenance takeover, the Docker route is convenient for version rollback, and it is clearer to choose one main route for the same site.
How do I migrate the data?Use the backup and restore function in the background, process the data and static files together, and check the attachment references after migration.
What should I do if the upgrade fails?First, restore the previous backup, then check the version number, and do not repeatedly execute the upgrade action under the failure condition.