Docker Deployment Steps

2022-07-22
No Rating

Install Docker

Install Docker Compose

Download Docker Source Code

Unzip the File

The directory structure after decompressing the cloud_api_sample_docker_1.0.0.zip file is as follows.

image-20220321112952651

  • data Store the user data when the demo service is running.

  • docker-compose.yml The running configuration file for docker-compose.

  • docs Store all types of documents, including API documents.

  • source Store source code and source files for all types of mirrors.

  • cloud_api_sample_docker_v1.0.0.tar Docker images for all environments.

  • README.md

  • update_backend.sh

    Build the back-end image file.

  • update_front.sh

    Build the front-end image file.

Load Images

Use the docker load command to load this image file.

  sudo docker load < cloud_api_sample_docker_v1.0.0.tar
  • Go to source/backend_service/src/main/resources, modify the backend configuration file "application.yml", modify the MySQL configuration, MQTT configuration, Redis configuration and object storage server configuration in the configuration file.

  • Go to source/nginx/front_page/src/api/http, modify the front-end configuration file "config.ts" and enter the appId, appKey and appLicense applied for on the developer website, see Application Tutorialopen in new window.

Note:

  • If you are not using the live function, you only need to set the baseURL and websocketURL first. If you are using the amap, you also need to apply for an amapKey on the official website of amap.
  • rtmp parameter is streaming server address.
  • Except for these two configuration files, nothing else needs to be changed for the time being, just build and start the project to try.
  • Go to the directory of the update_front.sh file and build the front and back-end images.

     # Build the front-end image file.
     ./update_front.sh
     
     # Build the back-end image file.
     ./update_backend.sh
    

Start the Container

Go to the path of the docker-compose.yml file and use docker-compose to start all the images.

  sudo docker-compose up -d

Login in Pilot 2

  1. Open pilot 2, go to the main page and click on Cloud Services to access it.

    GTScreenshot_20220321_232931.png

  2. Click Open Platforms in the bottom right-hand corner.

GTScreenshot_20220321_233150.png

  1. Enter the front-end access address (default: http://ip:8080/pilot-login), click on the Connect button in the top right-hand corner to access it.

    GTScreenshot_20220321_233344.png

  2. Click the Login button to log in.

    username: pilot

    password: pilot123

    GTScreenshot_20220321_233736.png

  3. If the main page shows Connected, you are successfully logged in, the remote control is connected to the emqx server and is pushing data. Now that the demo is up and running, you can click the back button on the remote control to return to the main page, as long as you don't click the exit button in the upper right corner, you will still be logged in.

    GTScreenshot_20220321_233859.png

  4. You can already see the information on the workspace on the main page. As long as the font is dark black, it means that you are still logged in, and the data of the remote control and the drone will be continuously pushed. If you want to exit the workspace, you only need to click enter again and then click the exit button in the upper right corner to exit, and the remote control and the drone will no longer push data.

    GTScreenshot_20220321_234607.png

Login Web Page

Default login page: http://ip:8080/project , ip should be changed to the real IP address that users are using.

username: adminPC

password: adminPC