Why are you messing with this thing?

Need to install a lot of the environment in our development process, some of the environment is very complicated to install, very not easy installed, sometimes need to change the computer or is to install an environment, the friend also has a lot of repetitive work, or don’t want a pile of may not be installed on your computer environment, So using Docker is undoubtedly the best choice, one-click operation

Use?

First of all to declare, this is not how perfect the environment, just some basic environment, in order to facilitate the beautiful people some simple daily application, if you need to expand you can improve it, or what is the common basic environment and advanced supplement can also contact me, I give the beautiful people up

Directions for use

1. Download basic project Docker-Common

Heckling of beautiful young people: say good one key run?? Should we at least clone the project, or expose it to the air? Ask for a star

Making the warehouse

Gitee warehouse

2. Run nginx as an example

  • Enter the docker-nginx directory and run it directlydocker-compose up -dOk, one-click run

Go ahead and visit localhost:8000.

Why localhost:8000? Because I like 8000, configure 8000, you don’t like to change the configuration file

To introduce the docker-nginx directory

etc

  • Ngxin nginx configuration
  • SSL HTTPS configuration

web

  • Public Nginx default page
  • Demo-a Common HTML service configuration
  • Demo-b single-page (vUE, React, etc.) project service configuration

Docker-compose. Yml Docker-compose configuration, which is used to configure ports and data mount, etc

Although the configuration is simple, I decided to briefly describe the add project

How do I add a new project

Let’s say we add a mall project called “Mall”

  • If you add an nginx configuration file to the /etc/nginx directory, add a mall. Conf file. For details about the configuration, see Demo-a.c onf and demo-b.conf

  • Conf to change the root path and a unique port number. If the port number conflicts, nginx will fail to start

  • After adding configuration and code, go to docker-comemess. yml and add exposed ports under ports

  • Complete the above three steps, you can restart
docker-compose up -d
Copy the code

Go to localhost:8011 and the mall runs with nothing

tips
  1. The Web and ETC directories are mounted to the container via data volumes, so direct changes to the contents outside the host machine will be synchronized directly into the container
  2. If we make changes to our code, we can directly synchronize them to the Docker container, without restarting the container
  3. If you change the nginx configuration, you need to go into the container and restart nginx, or restart the entire container

3. The lazy

The readme. md file for nginx is available in the directory below