Home > Web Front-end > JS Tutorial > body text

Use docker to automatically deploy to your own host based on daocloud

小云云
Release: 2018-01-03 15:01:55
Original
1709 people have browsed it

In front-end development, deploying projects is something that often happens to us. This article mainly talks about how to deploy vue projects elegantly, using docker containers and git webhook hooks. When we trigger the git hook event, we will deploy automatically. . Of course the suggestion here is the tag event.

Here I have finished writing the basic files of the project, you only need to copy this project to your vue project!

Project address docker vue project

Instructions for use

git clone https://github.com/devdocker/dao-vue

cp -r dao-vue vueitem

vueitem 是你的vue项目地址
Copy after login

At this time your project file structure

Use docker to automatically deploy to your own host based on daocloud

##Then go to the daocloud.io official website to create a new project based on this project

If you don’t know daocloud.io, it doesn’t matter, just register and read the documentation. I will write detailed documentation about daocloud.io in the future.

If you have used daocloud, please create a project, compile and publish, set trigger conditions, and automatically publish to your host. Of course, after deploying it to your server, write down the port and don’t make it dynamic.

Then you can use nginx upstream proxy_pass reverse proxy to solve cross-domain problems

The configuration is as follows

upstream webfenxi {
       server 127.0.0.1:8083; # 这是服务器使用docker启动的端口
}
server
   {
       listen 80;
       #listen [::]:80;
       server_name webfenxi.com ; # 这是绑定的自己的域名
       index index.html index.htm index.php default.html default.htm default.php;
       root  /home/wwwroot/webfenxi.com;

       include other.conf;
       #error_page   404   /404.html;

       # Deny access to PHP files in specific directory
       #location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }

       include enable-php.conf;

       location / {
               proxy_set_header X-Real-Ip $remote_addr;
               proxy_set_header X-Forward-For $proxy_add_x_forwarded_for;

               proxy_set_header X-Nginx-Proxy true;
               proxy_pass http://webfenxi;  # 代理地址
               proxy_redirect off;
              # try_files $uri $uri/ /index.html;
            }

         location /v1/ {
            proxy_pass http://api.xxxx.com/v1/;  #代理的接口,解决跨域问题
         }

         location ~ /.well-known {
             allow all;
         }

         location ~ /\.
         {
             deny all;
         }

         access_log  /home/wwwlogs/webfenxi.com.log;
     }
Copy after login
Related recommendations:

How to use Docker to deploy a PHP development environment

How to use Docker to build a Laravel environment

##docker Simple example of installing mysql

The above is the detailed content of Use docker to automatically deploy to your own host based on daocloud. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!