RAP
RAP is a visual interface management tool that analyzes the interface structure, dynamically generates simulation data, verifies the correctness of real interfaces, and improves our collaboration efficiency through a series of automation tools around interface definitions. Our slogan: Be efficient, go home for dinner!
RAP2 is a new project that builds on RAP1, which contains two components (corresponding to two Github Repositories).
Easily edit and share
Visual editing, perfect version control, import and export of various formats. It makes the work of front-end and back-end convention interfaces very simple
Mock service
RAP automatically generates mock interfaces based on interface documents, which automatically generate simulation data and support complex generation logic.
Guarantee of strength
Covering almost all departments of Alibaba, 200+ companies are using RAP, and after 4 years of accumulating a lot of experience, it can adapt to various complex business scenarios.
This topic deploys rap2 to provide interface management services for teams to improve the efficiency of development teams. There are many problems encountered during the deployment process, so I will make a summary here, one is to summarize my gains in the deployment process, and the other is to provide a little reference for peers who need to deploy rap2.
Deploy the environment
CentOS 7 x64-bit docker version: 1.13.1
understand
To deploy the rap2 system, you actually need to deploy two projects
rap2-dolores: The rap2 frontendGitHub address:https://github.com/thx/rap2-dolores
rap2-delos: The rap2 backendGitHub address:https://github.com/thx/rap2-delos
Deploy rap2-delos (backend)
rap2-delos: 后端数据API服务器,基于Koa + MySQL
Environment requirements:Node.js 8.9.4+, MySQL 5.7+, Redis 4.0+
Here, we use docker to deploy rap2-delos, which requires basic docker knowledge, omitted.
Docker Image image
The Docker image comes from Delos, that isThe image only contains the backend, not the frontend。 I packaged and uploaded the Dockerfile for some of the commits that I thought were more critical.
Image address:https://hub.docker.com/r/blackdog1987/rap2-delos/
Pull the latest docker image (as of the time of publication, the latest version is 2.6.0dcb5de)
Tag number The last paragraph of the tag is the code of commit. You can find the version corresponding to the image through the author's commit record. For example, 2.6.b90e5a1 is a mirror image of commit b90e5a1a63ee45d7165ec8cb2ca81212c20cd701. You can use docker images to view the native image
Modify the configuration in the docker-compose.xml. By default, I use the image of mysql and redis. You can modify it to your own configuration
Here, we use a third-party docker-compose.xml configuration, link:https://github.com/blackdog1987/ ... /docker-compose.yml
docker-compose.xml is not directly usable, it needs to be adjusted, and the file I modified is as follows:
Tourists, if you want to see the hidden content of this post, please Reply
I upload the file to the /root directory and execute the following command:
The execution is as follows:
Look at the container running: docker ps
Since I docker-compose.xml the configured file, it is to map the 8080 port of the rap2-delos container directly to the 80 port of the host machine, as shown in the figure above, I can directly access the external IP address, as shown in the figure below:
Since I mapped port 3306 of the mysql container to port 33306 of the host machine, I can directly access the MySQL database through port 33306 of the external network, and the username root password is empty, as shown in the figure below:
Here, please do a good job in database security, cancel the docker mysql container 3306 port mapping or make a policy on the firewall!
Here, the rap2-delos backend is deployed!!
Deploy rap2-dolores (frontend)
Configure the address of the backend server
Modify the /src/config/config.dev.js and /src/config/config.prod.js (production mode configuration file) files
Run
Sign up for an account and log in! How to package and deploy the frontend to the server will not be written here.
(End)
|