{"id":193162,"date":"2020-11-16T16:04:29","date_gmt":"2020-11-16T08:04:29","guid":{"rendered":"http:\/\/4563.org\/?p=193162"},"modified":"2020-11-16T16:04:29","modified_gmt":"2020-11-16T08:04:29","slug":"docker-vue-cli-%ef%bc%8c%e5%bc%80%e5%8f%91-hot-reload-%e6%97%b6%e7%bc%96%e8%af%91%e8%b6%85%e6%85%a2","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=193162","title":{"rendered":"docker + vue-cli \uff0c\u5f00\u53d1 hot-reload \u65f6\u7f16\u8bd1\u8d85\u6162"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  docker + vue-cli \uff0c\u5f00\u53d1 hot-reload \u65f6\u7f16\u8bd1\u8d85\u6162               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : leekafai <\/span>  <span><i><\/i> 0<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>windows10<\/p>\n<pre><code>FROM node:lts-alpine EXPOSE 22 8080 ENV CHOKIDAR_USEPOLLING=true RUN npm install -g @vue\/cli <\/code><\/pre>\n<p><code>docker run<\/code> \u7684\u65f6\u5019\u6302\u8f7d volume,vue-cli \u521d\u59cb\u5316\u9879\u76ee\u4ee3\u7801\u540e\uff0c\u53d1\u73b0\u4fee\u6539\u4ee3\u7801 hot-reload \u7684\u65f6\u5019\u8d85\u7ea7\u6162\uff0c\u6b63\u5e38\u4e3b\u673a\u53ef\u80fd\u53ea\u9700\u8981 4-6s\uff0cdocker \u91cc\u9762\u8981 60s+<\/p>\n<p>\u662f\u4ec0\u4e48\u539f\u56e0\u5f15\u8d77\u8fd9\u79cd\u95ee\u9898\uff0c\u6709\u6ca1\u6709\u529e\u6cd5\u4f18\u5316\u4e00\u4e0b\uff1f<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>5<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"4177536\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : wxsm <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             windows \u5e76\u4e0d\u652f\u6301\u5bb9\u5668\u6280\u672f\uff0c\u4f60\u7684 docker \u5b9e\u9645\u4e0a\u662f\u8dd1\u5728 linux \u865a\u62df\u673a\u91cc\u9762\u7684\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4177537\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : leekafai <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @wxsm \u54c7\u54e6\u786e\u5b9e\uff0c\u6211\u653e\u5230\u670d\u52a1\u5668\u4e0a\u9762\u8dd1\uff0c\u57fa\u672c\u4e0a\u79d2\u7ea7\u4e86\u3002\u770b\u6765 win \u4e0b\u662f\u4e3b\u673a-wsl-docker,\u5c42\u7ea7\u592a\u591a\u4e86                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4177538\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : x66 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6211\u731c\u662f wsl2 \u6302\u5728\u5728 \/mnt \u4e0b\u7684 windows \u78c1\u76d8\u662f\u901a\u8fc7\u7f51\u7edc\u534f\u8bae\u8bfb\u5199\u7684\uff0c\u5c0f\u6587\u4ef6\u592a\u591a\u5bfc\u81f4\u7684\u6027\u80fd\u95ee\u9898\u3002<br \/>\u4ee3\u7801\u653e\u5230\u5176\u4ed6\u76ee\u5f55\u8bd5\u8bd5\u5462                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4177539\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : xzysaber <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u9898\u4e3b\u662f\u7528\u7684 wsl2 \u5417\uff1f<br \/>\u8fd9\u4e2a\u662f wsl2 \u5df2\u77e5\u7684\u95ee\u9898\uff0chttps:\/\/github.com\/microsoft\/WSL\/issues\/4197<br \/>\u6211\u4e4b\u524d\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u662f\u901a\u8fc7\u5c06\u4ee3\u7801\u653e\u5230 wsl distros \u89e3\u51b3\u7684\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4177540\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : leekafai <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @xzysaber \u662f\u7684\uff0c\u6211\u8bd5\u4e86\u4e0b\u5728 linux \u4e0b\u5c31\u79d2\u597d\uff0c\u6211\u73b0\u5728\u76f4\u63a5\u5728\u53cc\u5341\u4e00\u4e70\u7684\u4e00\u4e2a ecs \u4e0a\u5f04\u4e86                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>docker + vue-cli &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/193162"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=193162"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/193162\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=193162"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=193162"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=193162"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}