Docker Deployment Steps
- Installation tutorial: https://docs.docker.com/engine/install/ubuntu/
Install Docker Compose
- Installation tutorial: https://docs.docker.com/compose/install/
Download Docker Source Code
- Click to download the Source Code
Unzip the File
The directory structure after decompressing the cloud_api_sample_docker_1.0.0.zip file is as follows.
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.
Build the back-end image file.
Build the front-end image file.
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 Tutorial.
- 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
Open pilot 2, go to the main page and click on Cloud Services to access it.
Click Open Platforms in the bottom right-hand corner.
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.
Click the Login button to log in.
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.
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.
Login Web Page
Default login page: http://ip:8080/project ,
ip should be changed to the real IP address that users are using.