DIY an exclusive personal network disk

I believe that many students have wanted to deploy their own personal network disks, but do not want to rent a server, worry about environment construction, and various complicated operation and maintenance tasks.

Now, with the birth of cloud hosting, the establishment of personal network disks has become so easy. It only takes a few steps, and the deployment is completed with one click. Soon! Here is a detailed introduction to the deployment process:

Cloud hosting (Tencent CloudBase Run) is a new generation of cloud native application engine (App Engine 2.0) provided by cloud development (Tencent CloudBase, TCB), which supports hosting any containerized applications.

Ready to work

Open CloudBase cloud development environment

note:

-Cloud hosting cannot be activated in a yearly and monthly subscription environment.

-Currently, the environment whose source is "WeChat Mini Program" does not support cloud hosting.

Step 1: Activate

Log in to the Cloud Development CloudBase console, select an environment, enter the cloud hosting management page, and click "Activate Now".


Step 2: Configure cloud hosting

Location

Currently, cloud hosting has opened the Shanghai and Guangzhou regions, and more regions will be opened one after another.

Cloud hosting network

Network settings include private network VPC and subnet. Taking the environment as the dimension, all services created in the cloud hosting will be deployed in the same VPC, and the network settings will not be changed after the cloud hosting is successfully activated.

The network settings are divided into the following two modes:

System default configuration

Cloud hosting will automatically create a VPC and subnet for you, and bind it to your current cloud development environment.

All subsequent services created in the cloud hosting in the current environment will be deployed to this VPC and subnet.

This process does not require you to manually set any settings. Later, you can view and manage this VPC and subnet automatically created by cloud hosting in the private network console, or you can deploy more cloud resources (such as cloud servers, cloud databases, etc.) in this VPC to facilitate these cloud resources To interact.

Custom configuration

If you have created a private network VPC and subnet before, and have deployed other cloud resources (such as cloud servers, cloud databases, etc.) in it, and need your cloud hosting application to interact with these existing cloud resources, you You can select "Custom Configuration", and then select a specific VPC and subnet.

Only one VPC can be selected, and multiple subnets can be selected.


Successfully opened

Click "Submit", the status will change to active , please wait a few seconds.


After successful activation, you will automatically jump to the cloud hosting service list page.

At this point, you have successfully activated the cloud hosting service. You can click "New Service" to start deploying our cloud storage.

New service

Click "New Service", fill in the service name, remarks (optional), and click "Submit".

Create kodexplorer a new directory named  and go to this directory:

mkdir kodexplorer
cd kodexplorer

Create Dockerfile a file named  and paste the following code (adjustable according to your needs) into it:

FROM php:7.3-apache

ENV Koddownload_URL http://static.kodcloud.com/update/download/kodbox.1.13.zip
##下载kodexplorer
RUN apt-get update && apt-get install -y --no-install-recommends unzip ca-certificates wget  \
    && wget -q -O /var/www/kodexplorer.zip ${Koddownload_URL} \
    && unzip -q /var/www/kodexplorer.zip -d /var/www/html \ 
    && rm -rf /var/cache/apk/* && rm -rf /var/lib/apt/lists/* 
##安装相关拓展
RUN apt-get update && apt-get install -y \
        libfreetype6-dev \
        libjpeg62-turbo-dev \
        libpng-dev \
        exiftool \
  && docker-php-ext-install -j$(nproc) iconv \
  && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
  && docker-php-ext-install -j$(nproc) gd \
  && docker-php-ext-install exif \
  && docker-php-ext-configure exif --enable-exif \
  && docker-php-ext-install pdo pdo_mysql \
  && cd /usr/local/bin && ./docker-php-ext-install mysqli \
  && rm -rf /var/cache/apk/*
##文件权限
RUN chmod -R 777 /var/www/html/
##工作目录
WORKDIR /var/www/html
##声明端口
EXPOSE 80

Deploy to cloud hosting

After entering the service, click "New Version", follow the steps in the figure, and click "Start Deployment" (the deployment time may take 5-10 minutes).

After the deployment is completed, click the "Service Configuration" above, click "Path", and modify it to/

Return to the version list and click "Access Service" to jump to the network disk configuration page

Follow the prompts and click Next to go to the database configuration page

Note: To use the MySQL database, you need to set the Tencent Cloud MySQL database under the same private network as the cloud hosting. The same applies to other types of databases.

After configuring the database, click OK, go to account settings, and log in to access the network disk interface after setting:

That's it!

to sum up

The above is the method of using cloud hosting to quickly deploy a personal network disk. The entire deployment process is simple and quick. Come and give it a try!

Author: Doggy, Tencent and so open channel publishing division.

Scan QR code to follow Tencent programmers

Guess you like

Origin blog.csdn.net/Tencent_TEG/article/details/112386252