As an experienced CMS website operation person in the field of information security, I know how eager readers are for deployment details, especially about the key configuration such as Docker container port and server port.The following is a detailed explanation of the correspondence between Docker container ports and server ports in the Panel of AnQiCMS.
Docker端口映射的核心机制
One of the core concepts of Docker is containerization and isolation.Each Docker container has its own independent network environment, and the AnQiCMS application running inside the container listens on a specific port to receive requests.内部监听端口默认且通常固定为8001This means that AnQiCMS application is running in a Docker container sandbox environment, expecting to receive all network traffic on port 8001.
However, in order for this internal service to be accessible from the host machine (your server) outside the container or from the internet, Docker introduces the port mapping mechanism.This mechanism binds a port on the host machine (i.e., 'server port') to a port inside the Docker container (i.e., 'container port').When an external request accesses a specific port of the host, Docker forwards these requests to the corresponding internal port of the container.
Port configuration in panelized deployment
In 1Panel or Baota panel such Docker management environments, the port configuration process is greatly simplified.
In1PanelWhen creating an AnQiCMS container, you will see the two options of "server port" and "container port". The AnQiCMS container,Internal port (container port) is usually kept at 8001.The 'server port' is specified by you, which represents which port on your host machine will be used to expose the AnQiCMS service.For a single AnQiCMS instance, you may also set the server port to 8001, so when external traffic accesses the host's 8001 port, it will be forwarded to the 8001 port inside the container.
Similarly, inBaota Panel (including the international version aaPanel)In the Docker application store, when installing AnQiCMS, the installation wizard will prompt you to set a 'port'. This port refers to the port on your host machine used to receive external connections.Server Port.AnQiCMS container's listening port is still 8001.http://127.0.0.1:YOUR_SERVER_PORTwhere,YOUR_SERVER_PORTThat is the server port you specify for this AnQiCMS instance in the panel, and Docker will route it to port 8001 inside the container.
Multiple AnQiCMS instance port management
The port mapping advantage of Docker is particularly evident when you need to run multiple AnQiCMS websites on the same server.
Each AnQiCMS website needs an independent Docker container to run. At this point, each AnQiCMS container contains the internal applicationStill listens to the default port 8001. To avoid port conflicts, you need to allocate a port on the host machine for each AnQiCMS Docker containerDifferent and unique server port.
For example, the server port of your first AnQiCMS instance can be 8001, the second can be 8002, the third can be 8003, and so on. The 1Panel interface clearly states: "If you need to install multiple containers, enter different ports for the server, such as 8002, 8003, etc., butContainer port is still only filled with 8001This configuration ensures that each AnQiCMS container on the host has a clear and non-conflicting access entry.