There are some default preconditions for this tutorial, so if you don’t meet any of the following, please check them out before you read on.

  • The default reader isgolangDevelopment of the novice, because I am also a novice, this tutorial is very tender.
  • The default reader has a mobile development background,IOS/android. Because we’re going to do one eventuallyappAlthough it is a very simpleapp.
  • The default reader hasgitThe foundation.
  • The default reader hasdockerdocker-composePrivate mirror warehouse use basis. It will be used in the tutorialdocker-composeTo set up the local environment, pushbuildGood local mirror to mirror warehouse, online environmentpullPrivate image deployment.
  • The default reader hasNginx, MySQL, RedisThe foundation. althoughGoIt’s very easy to buildwebService, but we are still based onNginxTo buildwebService.

Download tool

Install the Go language environment

Go language installation section you can consult the information. The online introduction is very comprehensive.

Go development IDE

Powerful IDE. Needless to say. But for people like me who don’t like cracking and are poor, I have to settle for a reboot every 30 minutes.

The Docker client

API Management Tools

Domestic team do API management tools, or very easy to use, to recommend a wave.

Coding Project Management

High level of appearance and powerful functions. The only joke is the login. I’m sick of it.

Local Environment Construction

To make it easy for you to deploy your local development environment, you can use the Docker-compose project I created.

Execute in the appropriate directory to avoid missing folders

git clone https://e.coding.net/bensonday/Ningxi/Ningxi-Compose.git
Copy the code

Ningxi-Compose

Env Indicates the configuration information required by each container. To change the file to hidden, shift + comd +. To show/hide

Docker-compose. Yml is the docker-compose configuration file.

The data folder is the local file directory mapped to each container

The conf folder contains the configuration files of each container

The logs folder contains the log files of each container

Env file to modify the configuration information, other files do not need to change.

Run the command in the ningxi-compose directory

docker-compose pull
Copy the code

This command will download all required images.

docker-compose start
Copy the code

This command will run all of the required containers. The following figure shows that the container is running properly

If you encounter golang Docker and other related environment configuration problems, please consult the relevant information.

This configuration also applies to online deployment.

Nginx is not used in the local environment, but Ningxi-compose is also configured with a very simple Web project.

Hello Ningxi

Previous post go-Zero Tutorial — Project Introduction

The next go-Zero tutorial: Service partitioning and Project Creation