Adding a Website Hosted by Docker Service
In ServBay, you can run and manage websites through Docker containers. This approach is not only flexible, but also easy to maintain and scale. This article will detail how to add a website hosted by Docker service in ServBay, including steps, precautions, and solutions to common problems.
Overview
ServBay provides a user-friendly interface that makes adding and managing websites hosted by Docker service very simple. By following the steps below, you can easily add a Docker-hosted website in ServBay and configure the relevant settings to ensure the website runs properly.
Steps to Add a Website
Step 1: Prepare the Docker Container
First, you need to ensure Docker is installed and running on your server. Then, create and run a Docker container to host your website. For instance, run a simple Nginx container using the following command:
docker run -d --name my-nginx -p 8080:80 nginx
In this example, the Nginx container will listen on port 8080 of the server.
Step 2: Open the ServBay Management Interface
Find ServBay
in the application and double-click to open.
Step 3: Navigate to Host Management
After opening the application, you will see the main interface of ServBay. In the navigation menu on the left, click on Host
. This will take you to the website management page.
Step 4: Add a New Website
On the website management page, click the +
button at the bottom of the page. This will open a new form on the right for entering the basic information of the new website.
Step 5: Configure Website Settings
In the page for adding a website, you need to fill in the following information:
- Name: The name of the website, used for identification.
- Domain: Enter the domain name of the website you are adding, such as
docker.demo
. - Protocol: The protocol supported by the website, default is HTTP/HTTPS.
- SSL Certificate Request Method: It is recommended to choose
Self-Signed
, which will automatically generate and manage the SSL certificate by ServBay. - Website Type: Select
Reverse Proxy
, specify that the website accesses the Docker container through reverse proxy. - IP Address: Enter
127.0.0.1
- Port: Enter the port that the Docker container is listening on, such as
8080
.
Step 6: Complete and Save
After filling in all the required information, click the Add
button. ServBay will automatically create the configuration for the new website and set it up on the host.
Once saved successfully, you can click the browser icon at the top right to visit the website.
Step 7: Quick Actions
ServBay provides a series of quick action buttons for the website, including:
- Open the website with IDE for quick editing
- Open the website in a browser
- View website logs
- Pause, start the website
- Delete the website
Summary
Adding a website hosted by Docker service in ServBay is a simple and intuitive process. By using Docker containers, you can manage and scale your website flexibly. Just follow the steps above to easily add and configure the new website. With proper configuration and management, you can ensure the website runs stably in the ServBay environment. If you encounter any issues, refer to the common problems and solutions for troubleshooting and fixing.