ASP. NET core combines Docker for source, deploy, update

Source: Internet
Author: User

Before going into the pit dotnet core, because the web that was first encountered in compiling the publication on Windows could not be directly placed on the CentOS execution. After that, you will study Docker directly, enabling you to compile the publication in the container. Then the more you play, the more you use Git's hooks to automate the Git source code to automatically get new codes and compile the release as soon as you receive the push. Finally, in order to facilitate reuse, directly into the unified configuration, so there is no need to write a complex script configuration. Just open the configuration file, configure several values, and run a script to OK.

There are currently two versions, and the original version includes the automatic cloning of the Git project. The V1 version takes git clones out of the human cloning. See the Readme document for details.

Technology stack
    1. ASP. NET Core
    2. Shell Script
    3. Python
    4. Docker
    5. Docker-compose
    6. Nginx
GitHub Address: Https://github.com/CrystalWindSnake/NetCore.Test.AutoDeployment.git

The record of the pit s (which is slowly replenished here) after the source update, after restarting the Web container, there will be a 502 error accessing the webpage again.

The reason for this is because of the Docker network mechanism. Each time the container starts, Docker assigns an IP address to the container, and if there is network traffic between the configuration containers (via links), the IP information of the connection container is recorded in the hooks file in the container. However, because the Web container restarts without restarting Nginx, the Nginx container also records the IP information of the previous Web container, causing the update to revisit the Web container when it accesses Nginx again.

The workaround is to configure a separate network (via Docker-compose). See the following interception configuration (DOCKER-COMPOSE.YML)

Version: ' 3 ' Services:    Web:       Networks:        -AUTO-CI-NW    Nginx:      Networks:        -AUTO-CI-NW                Networks:  AUTO-CI-NW:

  

  

ASP. NET core combines Docker for source, deploy, update

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.