Home > Article > Web Front-end > Use docker to automatically deploy to your own host based on daocloud
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
<span style="font-size: 16px;">git clone https://github.com/devdocker/dao-vue<br><br>cp -r dao-vue vueitem<br><br>vueitem 是你的vue项目地址<br></span>
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.
The configuration is as follows
<span style="font-size: 16px;">upstream webfenxi {<br> server 127.0.0.1:8083; # 这是服务器使用docker启动的端口<br>}<br>server<br> {<br> listen 80;<br> #listen [::]:80;<br> server_name webfenxi.com ; # 这是绑定的自己的域名<br> index index.html index.htm index.php default.html default.htm default.php;<br> root /home/wwwroot/webfenxi.com;<br><br> include other.conf;<br> #error_page 404 /404.html;<br><br> # Deny access to PHP files in specific directory<br> #location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }<br><br> include enable-php.conf;<br><br> location / {<br> proxy_set_header X-Real-Ip $remote_addr;<br> proxy_set_header X-Forward-For $proxy_add_x_forwarded_for;<br><br> proxy_set_header X-Nginx-Proxy true;<br> proxy_pass http://webfenxi; # 代理地址<br> proxy_redirect off;<br> # try_files $uri $uri/ /index.html;<br> }<br><br> location /v1/ {<br> proxy_pass http://api.xxxx.com/v1/; #代理的接口,解决跨域问题<br> }<br><br> location ~ /.well-known {<br> allow all;<br> }<br><br> location ~ /\.<br> {<br> deny all;<br> }<br><br> access_log /home/wwwlogs/webfenxi.com.log;<br> }<br></span>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 mysqlThe 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!