Deployment Overview of BrainyCP on Server¶
Prerequisites and Basic Requirements¶
-
Operating System: Ubuntu (compatible with
aptpackage manager). -
Privileges: Root access is required for installation and configuration.
-
Domain: The application is configured for the
hostkey.inzone. -
Ports:
-
Internal communication:
8000 -
External HTTPS access:
443
FQDN of the Final Panel¶
The fully qualified domain name for accessing the panel follows the format: brainycp<Server ID>.hostkey.in:443
File and Directory Structure¶
The deployment utilizes the following directory structure for configuration, data, and certificates:
-
Application installation directory:
/usr/local/brainycp -
Installer script location:
/root/install.sh -
Nginx configuration directory:
/root/nginx -
Nginx user configuration directory:
/data/nginx/user_conf.d -
Let's Encrypt secrets volume mount:
/etc/letsencrypt(mapped fromnginx_secrets)
Application Installation Process¶
The BrainyCP application is installed using a shell script provided by the developer. The process involves the following steps:
-
Verify if the installation directory
/usr/local/brainycpexists. -
If not present, ensure the
wgetutility is installed. -
Download the installer script from
http://core.brainycp.com/install.shto/root/install.sh. -
Execute the installer non-interactively using the command:
-
Reboot the server immediately after a successful installation to finalize the setup.
Docker Containers and Their Deployment¶
The reverse proxy and SSL management are handled via Docker containers using a docker compose configuration.
-
Compose File Location:
/root/nginx/compose.yml -
Service Name:
nginx -
Image:
jonasal/nginx-certbot:latest -
Restart Policy:
unless-stopped -
Network Mode:
host -
Environment Variables:
-
CERTBOT_EMAIL:[email protected] -
Volume Mounts:
-
nginx_secrets(external volume) mapped to/etc/letsencrypt -
/data/nginx/user_conf.dmapped to/etc/nginx/user_conf.d
To start the container stack, execute the following command from the /root/nginx directory:
Proxy Servers¶
The deployment utilizes Nginx with Certbot for SSL termination and reverse proxying.
-
Proxy Target: The Nginx configuration forwards traffic to the internal application service at
http://127.0.0.1:8002. -
Configuration File: The specific site configuration is located at
/data/nginx/user_conf.d/brainycp<Server ID>.hostkey.in.conf. -
SSL Management: Handled automatically by the
nginx-certbotcontainer using theletsencryptvolume.
Starting, Stopping, and Updating¶
Service management for the proxy layer is performed using Docker Compose commands within the /root/nginx directory.
-
Start/Restart:
-
Stop:
-
Update: To update the container image, pull the latest version and restart the service:
Available Ports for Connection¶
-
Port 443: External HTTPS access for the BrainyCP panel.
-
Port 8000: Internal port defined for the application (used internally by the system).
-
Port 8002: Internal port used by the Nginx proxy to forward requests to the application backend.