{"id":4068,"date":"2021-09-26T20:49:05","date_gmt":"2021-09-26T11:49:05","guid":{"rendered":"https:\/\/tech.akat.info\/?p=4068"},"modified":"2021-09-26T20:49:05","modified_gmt":"2021-09-26T11:49:05","slug":"windows-docker-%e3%81%ab%e3%81%a6-nuxt-js-%e3%81%ae-sample-%e3%83%9a%e3%83%bc%e3%82%b8%e3%82%92%e8%a1%a8%e7%a4%ba%e3%81%95%e3%81%9b%e3%82%8b","status":"publish","type":"post","link":"https:\/\/tech.akat.info\/?p=4068","title":{"rendered":"Windows + Docker \u306b\u3066 Nuxt.js \u306e Sample \u30da\u30fc\u30b8\u3092\u8868\u793a\u3055\u305b\u308b"},"content":{"rendered":"<p>\u4ee5\u4e0b\u3092\u53c2\u8003\u306b\u3057\u305f\u3002<br \/>\n\u30fb<a href=\"https:\/\/webxreal.com\/js_nuxt-introduction\/\">Windows\u3067\u3044\u304d\u306a\u308aNuxt.js\u306b\u5165\u9580\u3057\u3066\u307f\u308b<\/a><br \/>\n\u30fb<a href=\"https:\/\/www.ragate.co.jp\/blog\/articles\/1947\">\u30c8\u30ec\u30f3\u30c9\u306eVuejs\/Nuxt\u3092Aws ECS, Fargate\u3067SSR\u3001\u8a73\u7d30\u89e3\u8aac\u3057\u307e\u3059<\/a><\/p>\n<h2>Windows\u306b\u3066Nuxt.js\u3092\u52d5\u4f5c\u3055\u305b\u308b<\/h2>\n<p><a href=\"https:\/\/nodejs.org\/en\/\">node.js<\/a>\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nPS C:\\nuxt&gt; node --version\r\nv14.17.6\r\n\r\nPS C:\\nuxt&gt; npm --version\r\n6.14.15\r\n\r\nPS C:\\nuxt&gt; npm install -g vue-cli\r\n\r\nPS C:\\nuxt&gt; vue --version\r\n2.9.6\r\n\r\nPS C:\\nuxt&gt; vue init nuxt-community\/starter-template nuxt-sample\r\n? Project name nuxt-sample\r\n? Project description Nuxt.js project\r\n? Author\r\n\r\n   vue-cli \u00b7 Generated &quot;nuxt-sample&quot;.\r\n\r\n   To get started:\r\n\r\n     cd nuxt-sample\r\n     npm install # Or yarn\r\n     npm run dev\r\n\r\nPS C:\\nuxt&gt; cd nuxt-sample\r\n\r\nPS C:\\nuxt\\nuxt-sample&gt; npm i\r\n\r\nPS C:\\nuxt\\nuxt-sample&gt; npm run dev\r\n<\/pre>\n<p><a href=\"https:\/\/tech.akat.info\/wp-content\/uploads\/2021\/09\/2021-09-26_202708.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/tech.akat.info\/wp-content\/uploads\/2021\/09\/2021-09-26_202708-300x168.jpg\" alt=\"\" width=\"300\" height=\"168\" class=\"alignnone size-medium wp-image-4069\" srcset=\"https:\/\/tech.akat.info\/wp-content\/uploads\/2021\/09\/2021-09-26_202708-300x168.jpg 300w, https:\/\/tech.akat.info\/wp-content\/uploads\/2021\/09\/2021-09-26_202708-1024x574.jpg 1024w, https:\/\/tech.akat.info\/wp-content\/uploads\/2021\/09\/2021-09-26_202708-768x431.jpg 768w, https:\/\/tech.akat.info\/wp-content\/uploads\/2021\/09\/2021-09-26_202708-1536x861.jpg 1536w, https:\/\/tech.akat.info\/wp-content\/uploads\/2021\/09\/2021-09-26_202708.jpg 1696w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/localhost:3000\">http:\/\/localhost:3000<\/a> \u306b\u3066Sample\u30da\u30fc\u30b8\u3092\u8868\u793a\u53ef\u80fd\u3002<br \/>\n<a href=\"https:\/\/tech.akat.info\/wp-content\/uploads\/2021\/09\/2021-09-26_194910.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/tech.akat.info\/wp-content\/uploads\/2021\/09\/2021-09-26_194910-300x232.jpg\" alt=\"\" width=\"300\" height=\"232\" class=\"alignnone size-medium wp-image-4070\" srcset=\"https:\/\/tech.akat.info\/wp-content\/uploads\/2021\/09\/2021-09-26_194910-300x232.jpg 300w, https:\/\/tech.akat.info\/wp-content\/uploads\/2021\/09\/2021-09-26_194910-1024x792.jpg 1024w, https:\/\/tech.akat.info\/wp-content\/uploads\/2021\/09\/2021-09-26_194910-768x594.jpg 768w, https:\/\/tech.akat.info\/wp-content\/uploads\/2021\/09\/2021-09-26_194910-1536x1189.jpg 1536w, https:\/\/tech.akat.info\/wp-content\/uploads\/2021\/09\/2021-09-26_194910.jpg 1777w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>\u306a\u304a vue-cli \u5b9f\u884c\u6642\u306bPowerShell\u306e\u30dd\u30ea\u30b7\u30fc\u304cRestricted\u3067\u3042\u308c\u3070\u30a8\u30e9\u30fc\u3068\u306a\u308b\u305f\u3081\u6ce8\u610f\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nPS C:\\nuxt&gt; PowerShell Get-ExecutionPolicy\r\nRestricted\r\n\r\nPS C:\\nuxt&gt; vue --version\r\nvue : \u3053\u306e\u30b7\u30b9\u30c6\u30e0\u3067\u306f\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u5b9f\u884c\u304c\u7121\u52b9\u306b\u306a\u3063\u3066\u3044\u308b\u305f\u3081\u3001\u30d5\u30a1\u30a4\u30eb C:\\Users\\shimizu\\AppData\\Roaming\\npm\\vue.ps1 \u3092\r\n\u8aad\u307f\u8fbc\u3080\u3053\u3068\u304c\u3067\u304d\u307e\u305b\u3093\u3002\u8a73\u7d30\u306b\u3064\u3044\u3066\u306f\u3001\u300cabout_Execution_Policies\u300d(https:\/\/go.microsoft.com\/fwlink\/?LinkID=135170)\r\n\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002\r\n\u767a\u751f\u5834\u6240 \u884c:1 \u6587\u5b57:1\r\n+ vue --version\r\n+ ~~~\r\n    + CategoryInfo          : \u30bb\u30ad\u30e5\u30ea\u30c6\u30a3 \u30a8\u30e9\u30fc: (: ) &#x5B;]\u3001PSSecurityException\r\n    + FullyQualifiedErrorId : UnauthorizedAccess\r\n\r\nPS C:\\nuxt&gt; PowerShell Set-ExecutionPolicy RemoteSigned\r\n\r\nPS C:\\nuxt&gt; PowerShell Get-ExecutionPolicy\r\nRemoteSigned\r\n\r\nPS C:\\nuxt&gt; vue --version\r\n2.9.6\r\n<\/pre>\n<h2>Docker\u30b3\u30f3\u30c6\u30ca\u3068\u3057\u3066\u52d5\u4f5c\u3055\u305b\u308b<\/h2>\n<p>package.json \u306b &#8220;HOST=0.0.0.0 PORT=3000&#8221; \u3092\u8ffd\u52a0\u3059\u308b\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nPS C:\\nuxt\\nuxt-sample&gt; cat package.json\r\n...\r\n  &quot;scripts&quot;: {\r\n    &quot;dev&quot;: &quot;HOST=0.0.0.0 PORT=3000 nuxt&quot;,\r\n    &quot;build&quot;: &quot;nuxt build&quot;,\r\n    &quot;start&quot;: &quot;HOST=0.0.0.0 PORT=3000 nuxt start&quot;,\r\n...\r\n<\/pre>\n<p>Dockerfile\u3092\u4f5c\u6210\u3057\u3066\u3001\u30b3\u30f3\u30c6\u30ca\u3092\u5b9f\u884c\u3059\u308b\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nPS C:\\nuxt\\nuxt-sample&gt; cd ..\/\r\n\r\nPS C:\\nuxt&gt; cat Dockerfile\r\n\r\nFROM node:10.20.1-jessie\r\n\r\nRUN mkdir -p \/var\/www\/sampleproject\r\nWORKDIR \/var\/www\/sampleproject\r\nCOPY .\/nuxt-sample\/ \/var\/www\/sampleproject\r\nRUN npm run build\r\n\r\nEXPOSE 3000\r\n\r\nENTRYPOINT &#x5B;&quot;npm&quot;, &quot;run&quot;, &quot;start&quot;]\r\n\r\nPS C:\\nuxt&gt; docker build -t sampleproject .\r\n\r\nPS C:\\nuxt&gt; docker run -d -p 3000:3000 sampleproject\r\n<\/pre>\n<p><a href=\"http:\/\/localhost:3000\">http:\/\/localhost:3000<\/a> \u306b\u3066Sample\u30da\u30fc\u30b8\u3092\u8868\u793a\u53ef\u80fd\u3002<br \/>\n<a href=\"https:\/\/tech.akat.info\/wp-content\/uploads\/2021\/09\/2021-09-26_194910.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/tech.akat.info\/wp-content\/uploads\/2021\/09\/2021-09-26_194910-300x232.jpg\" alt=\"\" width=\"300\" height=\"232\" class=\"alignnone size-medium wp-image-4070\" srcset=\"https:\/\/tech.akat.info\/wp-content\/uploads\/2021\/09\/2021-09-26_194910-300x232.jpg 300w, https:\/\/tech.akat.info\/wp-content\/uploads\/2021\/09\/2021-09-26_194910-1024x792.jpg 1024w, https:\/\/tech.akat.info\/wp-content\/uploads\/2021\/09\/2021-09-26_194910-768x594.jpg 768w, https:\/\/tech.akat.info\/wp-content\/uploads\/2021\/09\/2021-09-26_194910-1536x1189.jpg 1536w, https:\/\/tech.akat.info\/wp-content\/uploads\/2021\/09\/2021-09-26_194910.jpg 1777w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4ee5\u4e0b\u3092\u53c2\u8003\u306b\u3057\u305f\u3002 \u30fbWindows\u3067\u3044\u304d\u306a\u308aNuxt.js\u306b\u5165\u9580\u3057\u3066\u307f\u308b \u30fb\u30c8\u30ec\u30f3\u30c9\u306eVuejs\/Nuxt\u3092Aws ECS, Fargate\u3067SSR\u3001\u8a73\u7d30\u89e3\u8aac\u3057\u307e\u3059 Windows\u306b\u3066Nuxt.js\u3092\u52d5\u4f5c\u3055\u305b\u308b nod [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[72],"tags":[],"_links":{"self":[{"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/posts\/4068"}],"collection":[{"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tech.akat.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4068"}],"version-history":[{"count":1,"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/posts\/4068\/revisions"}],"predecessor-version":[{"id":4071,"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/posts\/4068\/revisions\/4071"}],"wp:attachment":[{"href":"https:\/\/tech.akat.info\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4068"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tech.akat.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4068"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tech.akat.info\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4068"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}