What should be prepared in advance for port and data backup when deploying the enterprise website with Docker?

📅 2026-10-13 👁️ 12

To run the enterprise website with Docker, many people only pay attention to whether the 'image can be started', but are stuck at two things that were not prepared in advance when providing services to the outside world: port and data backup. If the port is not planned well, the service will start but cannot be accessed from outside; if the backup is not kept well, once the container is rebuilt, the data and the uploaded static files will be lost together. These two things are the most convenient to do before going online, and the cost of补 after going online is high. The deployment method of AnQiCMS includes Docker images, which are matched with the built-in backup and recovery capabilities, just corresponding to these two things.

How to determine the image and port mapping

The system provides a Docker image named anqicms/anqicms, which can bring up the site with a single command. This is also one of the points that makes it easier to deploy compared to the traditional PHP environment. However, the ports inside the container and the external ports of the host are two different things: the service inside the container listens to the default port 8001, and the host needs to decide which port to use externally, whether to use reverse proxy to convert it to 80 or 443, and these need to be considered before starting the container.

The common practice is to keep the default port 8001 inside the container, and then expose it to the outside through port mapping on the host machine. When setting the port, there are three points that need to be confirmed in advance: first, whether the target port on the host machine is occupied, second, whether the firewall and security group allow it, and third, when multiple sites coexist, the ports should not collide with each other. Writing the mapping relationship into the deployment instructions is much more stable than temporarily trying the ports.

How does the default port go out to the outside?

Default to listen on port 8001, this matter is easy to ignore, leading to 'Can be opened locally, but not on the Internet'. The reason is usually that only the container was started, no port mapping was done, or the mapping was done but the cloud server security group did not allow it. The correct link is: users visit the domain name, the reverse proxy receives on the host machine, and then forwards to the external mapping port of the container, finally landing on port 8001 within the container. If any link in the chain is not properly configured, external access is not possible. Therefore, before going online, the entire link should be verified in a complete loop, rather than just testing internally within the container and thinking that the deployment is complete.

How to keep data backup before going online

A feature of Docker is that the environment can be replaced, but the prerequisite for replacement is that the data can be recovered. The system's backup and recovery capabilities cover data and static files, that is, the content of the database and the resources such as uploaded images are all within the scope of backup, and can be restored when recovered. Before going online, it is necessary to confirm three things: the backup product falls on the container's persistent volume or host directory, rather than just in the writable layer of the container; the backup has a fixed rhythm rather than just a manual click once; the recovery process has been practiced once, knowing how to pull the site back from the backup.

It is particularly important to include static files in the backup. If the pictures and attachments on the official website only exist in the container, they will be lost when the container is rebuilt, and these are exactly the contents that are the most difficult to regenerate. Planning ports and planning backups are essentially two sides of the same thing: the former ensures that the service can provide services externally, and the latter ensures that the service can restart at any time.

Common questions

Do you have to use the default 8001 port?It is not necessary to expose 8001 externally, commonly used externally are 80 or 443; 8001 is mostly used as the port of the container service, which can be forwarded by the reverse proxy.

Will the data be lost if the container is deleted?As long as the data and static files are placed in a persistent volume and have a backup, they will not be lost; what is often lost is the part that has not been persisted or backed up.

What is the most important thing to verify before going live?Verify whether the access path 'domain to container 8001' is working, and then verify again whether the site can be brought up from the backup.

Related articles

How can new content be promoted faster to search engines, what do site maps and active push handle?

The site map manages the full volume handover, capturing all addressable URLs in the site at once; the proactive push ensures timely submission, immediately notifying the engine of new and updated addresses. To be indexed faster, both steps must be taken: first, confirm that the page status is a formal document and enter the automatically generated site map, then use link push to Baidu, Bing to push the address, and cooperate with stable static URLs to avoid duplicate versions.

2026-10-13

Robots.txt is not wrong but missing page capture, check these three places first.

The robots.txt is not written correctly, which is not a common cause of missed crawling. It is more effective to investigate in three places: first, confirm that the robots instruction is only for crawling, then check if the sitemap really hands over the page to be crawled, and finally, check the page's own blocking settings and address specifications. AnQiCMS supports automatic generation of robots configuration and sitemap, and both should be consistent with the actual address.

2026-10-13

After changing the pseudo-static rules, will the old links that have been indexed break, and how to make a safety net?

Changing the pseudo-static rules will make the old addresses no longer correspond to the original pages. Whether there will be a broken link depends on whether a list has been made in advance and 301 redirects have been set up. The method is to export the collected addresses before the change, and after the change, map the old addresses to the new addresses by directory prefix or item by item, and then check the sitemap and push results to ensure that there are no large-scale failed addresses in the crawling report.

2026-10-13

Which step should be done first when moving historical content in the old site restructuring, bulk import or 301 redirect?

The correct order for the reconstruction of the old site is to first import historical content in bulk, then configure 301 redirects: the import should first fall to the draft and be checked in batches, and only after confirming that the address is stable can the old links be redirected to the new address; reversing the order will cause the redirect to point to an empty page. AnQiCMS supports two bulk import methods: ZIP compressed packages and Excel spreadsheets, and deleted items go to the recycle bin, with 301 redirects covering the old links already indexed.

2026-10-13

What is the single file limit of the site map, and how to split it into index files when the URL exceeds ten thousand?

The number of entries and the volume limit of a single sitemap file are agreed upon by the protocol. When approaching or exceeding the limit, the file should be split into multiple sub-files and grouped using an index file, organized by category and update time. This article explains the limit from the sitemap protocol, how to split when exceeding the limit, and the method of supplementing the collection时效 through active push after splitting.

2026-10-13

The page engine for the newly published page is taking a long time to crawl, which part does the sitemap and IndexNow manage?

New pages are not indexed in time, first distinguish which part of the site map and IndexNow are responsible for the indexing chain: The site map provides a complete list and tells the engine what is on the site; IndexNow and similar real-time notification mechanisms are responsible for informing participating engines of content changes as soon as possible. Both complement each other, and full and incremental two chains need to be configured in the site to ensure the timeliness of indexing.

2026-10-13

How to read the 'remain' and 'not_valid' fields after submitting the link to Baidu's push interface

According to Baidu Search Resource Platform documentation, when the API push is successful, it returns the four fields: success, remain, not_same_site, and not_valid: remain is the remaining quota for the day, and not_valid is the list of invalid links; when it fails, it returns client error codes starting with 4 or a 500 server error code. This article discusses the troubleshooting order by field and explains which part of the link push and sitemap covers the link inclusion path.

2026-10-13

Writing nofollow in robots.txt actually does not take effect, which standards recognize which fields.

The standard text for excluding by robots, the fields only include User-agent and Disallow groups, nofollow is not defined in robots.txt, and it will not be parsed according to the standard. This article distinguishes between blocking crawling and blocking inclusion: crawling is controlled by robots configuration, inclusion is based on page-level control and server-side redirect convergence, and on-site robots settings and 301 redirect each have their own responsibilities.

2026-10-13