{"id":2985,"date":"2017-04-04T08:00:22","date_gmt":"2017-04-04T15:00:22","guid":{"rendered":"https:\/\/www.couchbase.com\/blog\/?p=2985"},"modified":"2025-06-13T20:15:22","modified_gmt":"2025-06-14T03:15:22","slug":"deploy-node-js-couchbase-web-application-docker-containers","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/deploy-node-js-couchbase-web-application-docker-containers\/","title":{"rendered":"Docker Node.js Deployment With Couchbase"},"content":{"rendered":"<p>Docker is becoming increasingly popular and I&#8217;ve been slowly introducing it into my projects. \u00a0It makes it easy to distribute your applications because regardless of where you deploy your containers to, the experience will be the same. <span style=\"font-weight: 400\">Let\u2019s see how this works using Docker and Node.js, which has many variations. While they generally work <\/span><span style=\"font-weight: 400\">regardless of the<\/span><span style=\"font-weight: 400\"> web application scenario, you can\u2019t truly be sure when using the Node.js runtime.<\/span><\/p>\n<p>We&#8217;re going to see how to build a custom <a href=\"https:\/\/www.couchbase.com\/resources\/why-nosql\/\">NoSQL<\/a> container and deploy it alongside a custom web application container that makes use of Node and Docker to encapsulate the needed <a href=\"https:\/\/www.couchbase.com\" target=\"_blank\" rel=\"noopener noreferrer\">Couchbase<\/a> functions.<\/p>\n<h2>What is Node.js?<\/h2>\n<p>Before we get to the tutorial, let&#8217;s spend a minute defining <strong>Node.js<\/strong>. Instead of running inside a browser, Node is an open source and fully cross-platform runtime for executing JavaScript in a server environment. With Node.js, developers can create fully cloud applications that operate invisibly to users but which provide crucial functionality in modern enterprises. Couchbase is optimized to execute applications built with Node.js. This tutorial demonstrates how to harness this capability by pairing Node.js and Docker containers.<\/p>\n<p><!--more--><\/p>\n<p>If this is your first time being exposed to <a href=\"https:\/\/www.docker.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">Docker<\/a> containers, let&#8217;s break down what we&#8217;re hoping to accomplish. \u00a0Couchbase has published an official Docker image to <a href=\"https:\/\/hub.docker.com\/_\/couchbase\/\" target=\"_blank\" rel=\"noopener noreferrer\">Docker Hub<\/a> for Node.js developers, but the image is not pre-provisioned. \u00a0That is not a bad thing and it is definitely what we would hope to expect in a database container. \u00a0This means that we need to create a custom image based on the official image, otherwise when we deploy Couchbase, it won&#8217;t have been set up. \u00a0We&#8217;re going to <a href=\"https:\/\/www.couchbase.com\/blog\/containerize-node-js-application-communicates-couchbase-server\/\">write an application in Node.js and &#8220;Dockerize&#8221; it<\/a> into a container package. \u00a0These two Couchbase and Node.js Docker containers will be able to communicate with each other.<\/p>\n<h2>Creating a Custom Couchbase Server Docker Image and Container<\/h2>\n<p>Create a directory somewhere on your computer and include the following two files:<\/p>\n<pre class=\"lang:default highlight:0 decode:true \">Dockerfile\r\nconfigure.sh<\/pre>\n<p>The sample dockerfile &#8212; <strong>Dockerfile<\/strong> &#8212; will represent our custom image, and the <strong>configure.sh<\/strong> file will be a runtime script for when we deploy our container.<\/p>\n<p>Open the\u00a0<strong>Dockerfile<\/strong> file and include the following:<\/p>\n<pre class=\"lang:default highlight:0 decode:true \">FROM couchbase\r\n\r\nCOPY configure.sh \/opt\/couchbase\r\n\r\nCMD [\"\/opt\/couchbase\/configure.sh\"]<\/pre>\n<p>Our custom image will use the official Couchbase image as the base. \u00a0At build time, the configuration script will be copied to the image. \u00a0When run, the script will be executed. \u00a0Let&#8217;s take a look at that script.<\/p>\n<p>Open the\u00a0<strong>configure.sh<\/strong> file and include the following:<\/p>\n<pre class=\"lang:default highlight:0 decode:true \">set -m\r\n\r\n\/entrypoint.sh couchbase-server &amp;\r\n\r\nsleep 15\r\n\r\ncurl -v -X POST https:\/\/127.0.0.1:8091\/pools\/default -d memoryQuota=512 -d indexMemoryQuota=512\r\n\r\ncurl -v https:\/\/127.0.0.1:8091\/node\/controller\/setupServices -d services=kv%2cn1ql%2Cindex\r\n\r\ncurl -v https:\/\/127.0.0.1:8091\/settings\/web -d port=8091 -d username=$COUCHBASE_ADMINISTRATOR_USERNAME -d password=$COUCHBASE_ADMINISTRATOR_PASSWORD\r\n\r\ncurl -i -u $COUCHBASE_ADMINISTRATOR_USERNAME:$COUCHBASE_ADMINISTRATOR_PASSWORD -X POST https:\/\/127.0.0.1:8091\/settings\/indexes -d 'storageMode=memory_optimized'\r\n\r\ncurl -v -u $COUCHBASE_ADMINISTRATOR_USERNAME:$COUCHBASE_ADMINISTRATOR_PASSWORD -X POST https:\/\/127.0.0.1:8091\/pools\/default\/buckets -d name=$COUCHBASE_BUCKET -d bucketType=couchbase -d ramQuotaMB=128 -d authType=sasl -d saslPassword=$COUCHBASE_BUCKET_PASSWORD\r\n\r\nsleep 15\r\n\r\ncurl -v https:\/\/127.0.0.1:8093\/query\/service -d \"statement=CREATE PRIMARY INDEX ON \\`$COUCHBASE_BUCKET\\`\"\r\n\r\nfg 1<\/pre>\n<p>Again, the point of the\u00a0<strong>configure.sh<\/strong> script is to provision the server after it is launched. \u00a0To do this, we can make use of the Couchbase RESTful API. \u00a0Configuration includes creating a cluster, enabling Couchbase services, defining administration credentials, creating a Bucket, and creating a N1QL index on the bucket.<\/p>\n<p>In the configuration script you&#8217;ll notice several environment variables being used, for example the\u00a0<code>$COUCHBASE_ADMINISTRATOR_USERNAME<\/code> variable. \u00a0This will save us from hard-coding potentially sensitive information into the image. \u00a0Instead we can define these variables at deployment.<\/p>\n<p>Now let&#8217;s build the custom Couchbase image for our project. \u00a0From the Docker Shell, execute the following:<\/p>\n<pre class=\"lang:default highlight:0 decode:true \">docker build -t couchbase-custom \/path\/to\/directory\/with\/dockerfile<\/pre>\n<p>In the above command, the\u00a0<code>couchbase-custom<\/code> text is the name of our image, while the path is the path to our\u00a0<strong>Dockerfile<\/strong> and\u00a0<strong>configure.sh<\/strong> files.<\/p>\n<p>With the custom image created for Couchbase, execute the following command to run it:<\/p>\n<pre class=\"lang:default highlight:0 decode:true \">docker run -d \\\r\n-p 8091-8093:8091-8093 \\\r\n-e COUCHBASE_ADMINISTRATOR_USERNAME=Administrator \\\r\n-e COUCHBASE_ADMINISTRATOR_PASSWORD=password \\\r\n-e COUCHBASE_BUCKET=default \\\r\n-e COUCHBASE_BUCKET_PASSWORD= \\\r\n--network=\"docker_default\" \\\r\n--name couchbase \\\r\ncouchbase-custom<\/pre>\n<p>The above command says we want to deploy a container, mapping each of the necessary Couchbase ports. \u00a0We pass in the environment variables that are found in our\u00a0<strong>configure.sh<\/strong> script and we define which network we want the container to run on. \u00a0The container will be named\u00a0<code>couchbase<\/code>, which is also going to be the container&#8217;s host name.<\/p>\n<h2>Creating a Node.js RESTful API Web Application<\/h2>\n<p>With Couchbase up and running, we can develop a simple Node.js application. \u00a0Create a directory somewhere on your computer to represent our project. \u00a0Within that project, create an\u00a0<strong>app.js<\/strong> file.\u00a0 We&#8217;re going to be installing private packages with NPM in a Docker container. From the Command Prompt or Terminal, execute the following:<\/p>\n<pre class=\"lang:default highlight:0 decode:true \">npm init --y<\/pre>\n<p>The above command will create a very basic\u00a0<strong>package.json<\/strong> file which will be the foundation of our Node.js application. \u00a0There are a few dependencies that must be installed, so let&#8217;s execute the following to obtain them:<\/p>\n<pre class=\"lang:default highlight:0 decode:true \">npm install express couchbase body-parser uuid --save<\/pre>\n<p>We&#8217;ll be using <code>express<\/code>\u00a0for building our API, <code>couchbase<\/code>\u00a0as our SDK,\u00a0<code>body-parser<\/code> for working with POST bodies, and\u00a0<code>uuid<\/code> for generating unique id values that will represent document keys.<\/p>\n<p>With the application foundation in place, we can start developing the application. \u00a0Open the project&#8217;s\u00a0<strong>app.js<\/strong> file and include the following code:<\/p>\n<pre class=\"lang:default highlight:0 decode:true \">var Couchbase = require(\"couchbase\");\r\nvar Express = require(\"express\");\r\nvar BodyParser = require(\"body-parser\");\r\nvar UUID = require(\"uuid\");\r\n\r\nvar app = Express();\r\nvar N1qlQuery = Couchbase.N1qlQuery;\r\nvar bucket = (new Couchbase.Cluster(\"couchbase:\/\/\" + process.env.COUCHBASE_HOST)).openBucket(process.env.COUCHBASE_BUCKET, process.env.COUCHBASE_BUCKET_PASSWORD);\r\n\r\napp.use(BodyParser.json());\r\n\r\napp.get(\"\/\", function(request, response) {\r\n    response.send(\"Try using the `\/get` or `\/save` endpoints!\");\r\n});\r\n\r\napp.get(\"\/get\", function(request, response) {\r\n    var query = N1qlQuery.fromString(\"SELECT `\" + bucket._name + \"`.* FROM `\" + bucket._name + \"`\");\r\n    bucket.query(query, function(error, result) {\r\n        if(error) {\r\n            return response.status(500).send(error);\r\n        }\r\n        response.send(result);\r\n    });\r\n});\r\n\r\napp.post(\"\/save\", function(request, response) {\r\n    bucket.insert(UUID.v4(), request.body, function(error, result) {\r\n        if(error) {\r\n            return response.status(500).send(error);\r\n        }\r\n        response.send(result);\r\n    });\r\n});\r\n\r\nvar server = app.listen(process.env.APPLICATION_PORT || 3000, function() {\r\n    console.log(\"Listening on port \" + server.address().port + \"...\");\r\n});<\/pre>\n<p>So what is happening in the above code?<\/p>\n<p>First we import all the downloaded dependencies and then we establish a connection to Couchbase. \u00a0You&#8217;ll notice that we are using\u00a0<code>process.env<\/code> throughout the code. \u00a0This allows us to read environment variables. \u00a0We&#8217;re going to be using a similar approach to what we saw in the Couchbase image.<\/p>\n<p>The API has two endpoints that actually do anything. \u00a0The\u00a0<code>\/save<\/code> endpoint will insert whatever is in the request body and the\u00a0<code>\/get<\/code> endpoint will query for whatever is saved in Couchbase.<\/p>\n<h2>Containerizing the Node.js Web Application<\/h2>\n<p>With the application built, we need to containerize it so it can be deployed easily with Docker. \u00a0In the same directory as your\u00a0<strong>package.json<\/strong> file, add the following two files:<\/p>\n<pre class=\"lang:default highlight:0 decode:true \">Dockerfile\r\n.dockerignore<\/pre>\n<p>The plan is to create a custom image based on the official Node.js Docker image. \u00a0Within the\u00a0<strong>Dockerfile<\/strong> file, include the following:<\/p>\n<pre class=\"lang:default highlight:0 decode:true \">FROM node:6-alpine\r\n\r\nCOPY . \/srv\/\r\nWORKDIR \/srv\r\n\r\nRUN \/usr\/local\/bin\/npm install\r\n\r\nCMD \/usr\/local\/bin\/node app.js<\/pre>\n<p>During the image build time, we are going to copy our project into the image filesystem and change the working directory. \u00a0Then we are going to install all the dependencies found in the\u00a0<strong>package.json<\/strong> file. \u00a0When the container is deployed, the\u00a0<strong>app.js<\/strong> file will be ran.<\/p>\n<p>You might be wondering why we are doing an install when we build the image. \u00a0We are doing this because we don&#8217;t want to copy the dependencies into the image as there could be OS and architecture incompatibilities. \u00a0To exclude the\u00a0<strong>node_modules<\/strong> directory from our image, include the following in the\u00a0<strong>.dockerignore<\/strong> file:<\/p>\n<pre class=\"lang:default highlight:0 decode:true \">node_modules<\/pre>\n<p>Anything you want excluded from the image can go in that file.<\/p>\n<p>To build this image, execute the following from the Docker Shell:<\/p>\n<pre class=\"lang:default highlight:0 decode:true \">docker build -t nodejs-custom \/path\/to\/directory\/with\/dockerfile<\/pre>\n<p>The image name for our Node.js application will be called\u00a0<code>nodejs-custom<\/code> and it will be based on the directory that contains the\u00a0<strong>Dockerfile<\/strong> file. \u00a0More information on building custom Docker images can be found in a <a href=\"https:\/\/www.thepolyglotdeveloper.com\/2017\/03\/build-custom-docker-image-containerized-web-application\/\" target=\"_blank\" rel=\"noopener noreferrer\">previous article<\/a> that I wrote.<\/p>\n<p>With the image available, we need to run it. \u00a0From the Docker Shell, execute the following:<\/p>\n<pre class=\"lang:default highlight:0 decode:true \">docker run -d \\\r\n-p 3000:3000 \\\r\n-e COUCHBASE_HOST=couchbase \\\r\n-e COUCHBASE_BUCKET=default \\\r\n-e COUCHBASE_BUCKET_PASSWORD= \\\r\n-e APPLICATION_PORT=3000 \\\r\n--network=\"docker_default\" \\\r\n--name nodejs \\\r\nnodejs-custom<\/pre>\n<p>The above command should look familiar to what we saw in the Couchbase deployment. \u00a0We are defining the port mapping of our application, passing in the environment variables that are used in the\u00a0<strong>app.js<\/strong> file, defining the container network and the image name.<\/p>\n<p>If you go to your web browser and navigate to any of the endpoints of the web application, it should work fine.<\/p>\n<h2>Using a Compose File for Deploying Docker Containers<\/h2>\n<p>Having to\u00a0remember all the environment variables and everything in the command for deploying the containers can be painful. \u00a0Creating a Compose file can make things a lot simpler.<\/p>\n<p>After you&#8217;ve created your two custom images, create a\u00a0<strong>docker-compose.yml<\/strong> file somewhere on your computer. \u00a0This file should contain the following:<\/p>\n<pre class=\"lang:default highlight:0 decode:true\">version: '2'\r\n\r\nservices:\r\n    couchbase:\r\n        image: couchbase-custom\r\n        ports:\r\n            - 8091:8091\r\n            - 8092:8092\r\n            - 8093:8093\r\n        environment:\r\n            - COUCHBASE_ADMINISTRATOR_USERNAME=Administrator\r\n            - COUCHBASE_ADMINISTRATOR_PASSWORD=password\r\n            - COUCHBASE_BUCKET=default\r\n            - COUCHBASE_BUCKET_PASSWORD=\r\n\r\n    nodejs:\r\n        image: nodejs-custom\r\n        ports:\r\n            - 3000:3000\r\n        environment:\r\n            - COUCHBASE_HOST=couchbase\r\n            - COUCHBASE_BUCKET=default\r\n            - COUCHBASE_BUCKET_PASSWORD=\r\n            - APPLICATION_PORT=3000\r\n        restart: always<\/pre>\n<p>When using Compose, you don&#8217;t have to worry about defining the network as everything in the file will be on the same network. \u00a0To launch either of the containers, you can execute the following:<\/p>\n<pre class=\"lang:default highlight:0 decode:true \">docker-compose run -d --service-ports --name couchbase couchbase<\/pre>\n<p>With Couchbase, you can&#8217;t spin everything up together because Couchbase doesn&#8217;t have a method of telling you when it is ready. \u00a0Because of this, the Node.js application might try to connect before Couchbase is ready to accept connections.<\/p>\n<pre class=\"lang:default highlight:0 decode:true \">docker-compose up -d<\/pre>\n<p>The above command usually spins up all containers in the Compose file, but we can&#8217;t use it in this scenario.<\/p>\n<h2>Conclusion<\/h2>\n<p>If you&#8217;re wondering how you can deploy your Node.js with Couchbase web application, Docker is an easy solution. \u00a0After building images of either Couchbase or Node.js, you can trust that it will work the same on any server or computer running the Docker Engine.<\/p>\n<p>For more information on using the Couchbase Node.js SDK, check out the <a href=\"https:\/\/developer.couchbase.com\/documentation\/server\/current\/sdk\/nodejs\/start-using-sdk.html\" target=\"_blank\" rel=\"noopener noreferrer\">Couchbase Developer Portal<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Docker is becoming increasingly popular and I&#8217;ve been slowly introducing it into my projects. \u00a0It makes it easy to distribute your applications because regardless of where you deploy your containers to, the experience will be the same. Let\u2019s see how [&hellip;]<\/p>\n","protected":false},"author":63,"featured_media":13873,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[1815,1816,9327,1822],"tags":[1520,1519,1896,1543,1776],"ppma_author":[9032],"class_list":["post-2985","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-best-practices-and-tutorials","category-couchbase-server","category-javascript","category-node-js","tag-containers","tag-docker","tag-docker-compose","tag-javascript","tag-web-application"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.8 (Yoast SEO v25.8) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Docker Node.js Deployment With Couchbase Web Application<\/title>\n<meta name=\"description\" content=\"Create a Node.js application that uses Couchbase Server along with Docker containers for web app deployment. \u2713 Learn more with Couchbase!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.couchbase.com\/blog\/deploy-node-js-couchbase-web-application-docker-containers\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Docker Node.js Deployment With Couchbase\" \/>\n<meta property=\"og:description\" content=\"Create a Node.js application that uses Couchbase Server along with Docker containers for web app deployment. \u2713 Learn more with Couchbase!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/deploy-node-js-couchbase-web-application-docker-containers\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/thepolyglotdeveloper\" \/>\n<meta property=\"article:published_time\" content=\"2017-04-04T15:00:22+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-14T03:15:22+00:00\" \/>\n<meta name=\"author\" content=\"Nic Raboy, Developer Advocate, Couchbase\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@nraboy\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Nic Raboy, Developer Advocate, Couchbase\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/deploy-node-js-couchbase-web-application-docker-containers\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/deploy-node-js-couchbase-web-application-docker-containers\/\"},\"author\":{\"name\":\"Nic Raboy, Developer Advocate, Couchbase\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/bb545ebe83bb2d12f91095811d0a72e1\"},\"headline\":\"Docker Node.js Deployment With Couchbase\",\"datePublished\":\"2017-04-04T15:00:22+00:00\",\"dateModified\":\"2025-06-14T03:15:22+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/deploy-node-js-couchbase-web-application-docker-containers\/\"},\"wordCount\":1402,\"commentCount\":3,\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/deploy-node-js-couchbase-web-application-docker-containers\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"keywords\":[\"containers\",\"docker\",\"docker-compose\",\"javascript\",\"web application\"],\"articleSection\":[\"Best Practices and Tutorials\",\"Couchbase Server\",\"JavaScript\",\"Node.js\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/deploy-node-js-couchbase-web-application-docker-containers\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/deploy-node-js-couchbase-web-application-docker-containers\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/deploy-node-js-couchbase-web-application-docker-containers\/\",\"name\":\"Docker Node.js Deployment With Couchbase Web Application\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/deploy-node-js-couchbase-web-application-docker-containers\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/deploy-node-js-couchbase-web-application-docker-containers\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"datePublished\":\"2017-04-04T15:00:22+00:00\",\"dateModified\":\"2025-06-14T03:15:22+00:00\",\"description\":\"Create a Node.js application that uses Couchbase Server along with Docker containers for web app deployment. \u2713 Learn more with Couchbase!\",\"breadcrumb\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/deploy-node-js-couchbase-web-application-docker-containers\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/deploy-node-js-couchbase-web-application-docker-containers\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/deploy-node-js-couchbase-web-application-docker-containers\/#primaryimage\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"width\":1800,\"height\":630},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/deploy-node-js-couchbase-web-application-docker-containers\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.couchbase.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Docker Node.js Deployment With Couchbase\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\",\"url\":\"https:\/\/www.couchbase.com\/blog\/\",\"name\":\"The Couchbase Blog\",\"description\":\"Couchbase, the NoSQL Database\",\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.couchbase.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\",\"name\":\"The Couchbase Blog\",\"url\":\"https:\/\/www.couchbase.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png\",\"width\":218,\"height\":34,\"caption\":\"The Couchbase Blog\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/bb545ebe83bb2d12f91095811d0a72e1\",\"name\":\"Nic Raboy, Developer Advocate, Couchbase\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/8863514d8bed0cf6080f23db40e00354\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/bedeb68368d4681aca4c74fe5f697f0c423b80d498ec50fd915ba018b72c101f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/bedeb68368d4681aca4c74fe5f697f0c423b80d498ec50fd915ba018b72c101f?s=96&d=mm&r=g\",\"caption\":\"Nic Raboy, Developer Advocate, Couchbase\"},\"description\":\"Nic Raboy is an advocate of modern web and mobile development technologies. He has experience in Java, JavaScript, Golang and a variety of frameworks such as Angular, NativeScript, and Apache Cordova. Nic writes about his development experiences related to making web and mobile development easier to understand.\",\"sameAs\":[\"https:\/\/www.thepolyglotdeveloper.com\",\"https:\/\/www.facebook.com\/thepolyglotdeveloper\",\"https:\/\/x.com\/nraboy\"],\"url\":\"https:\/\/www.couchbase.com\/blog\/author\/nic-raboy-2\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Docker Node.js Deployment With Couchbase Web Application","description":"Create a Node.js application that uses Couchbase Server along with Docker containers for web app deployment. \u2713 Learn more with Couchbase!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.couchbase.com\/blog\/deploy-node-js-couchbase-web-application-docker-containers\/","og_locale":"en_US","og_type":"article","og_title":"Docker Node.js Deployment With Couchbase","og_description":"Create a Node.js application that uses Couchbase Server along with Docker containers for web app deployment. \u2713 Learn more with Couchbase!","og_url":"https:\/\/www.couchbase.com\/blog\/deploy-node-js-couchbase-web-application-docker-containers\/","og_site_name":"The Couchbase Blog","article_author":"https:\/\/www.facebook.com\/thepolyglotdeveloper","article_published_time":"2017-04-04T15:00:22+00:00","article_modified_time":"2025-06-14T03:15:22+00:00","author":"Nic Raboy, Developer Advocate, Couchbase","twitter_card":"summary_large_image","twitter_creator":"@nraboy","twitter_misc":{"Written by":"Nic Raboy, Developer Advocate, Couchbase","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/deploy-node-js-couchbase-web-application-docker-containers\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/deploy-node-js-couchbase-web-application-docker-containers\/"},"author":{"name":"Nic Raboy, Developer Advocate, Couchbase","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/bb545ebe83bb2d12f91095811d0a72e1"},"headline":"Docker Node.js Deployment With Couchbase","datePublished":"2017-04-04T15:00:22+00:00","dateModified":"2025-06-14T03:15:22+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/deploy-node-js-couchbase-web-application-docker-containers\/"},"wordCount":1402,"commentCount":3,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/deploy-node-js-couchbase-web-application-docker-containers\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","keywords":["containers","docker","docker-compose","javascript","web application"],"articleSection":["Best Practices and Tutorials","Couchbase Server","JavaScript","Node.js"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.couchbase.com\/blog\/deploy-node-js-couchbase-web-application-docker-containers\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/deploy-node-js-couchbase-web-application-docker-containers\/","url":"https:\/\/www.couchbase.com\/blog\/deploy-node-js-couchbase-web-application-docker-containers\/","name":"Docker Node.js Deployment With Couchbase Web Application","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/deploy-node-js-couchbase-web-application-docker-containers\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/deploy-node-js-couchbase-web-application-docker-containers\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","datePublished":"2017-04-04T15:00:22+00:00","dateModified":"2025-06-14T03:15:22+00:00","description":"Create a Node.js application that uses Couchbase Server along with Docker containers for web app deployment. \u2713 Learn more with Couchbase!","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/deploy-node-js-couchbase-web-application-docker-containers\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/deploy-node-js-couchbase-web-application-docker-containers\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/deploy-node-js-couchbase-web-application-docker-containers\/#primaryimage","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","width":1800,"height":630},{"@type":"BreadcrumbList","@id":"https:\/\/www.couchbase.com\/blog\/deploy-node-js-couchbase-web-application-docker-containers\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Docker Node.js Deployment With Couchbase"}]},{"@type":"WebSite","@id":"https:\/\/www.couchbase.com\/blog\/#website","url":"https:\/\/www.couchbase.com\/blog\/","name":"The Couchbase Blog","description":"Couchbase, the NoSQL Database","publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.couchbase.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.couchbase.com\/blog\/#organization","name":"The Couchbase Blog","url":"https:\/\/www.couchbase.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png","width":218,"height":34,"caption":"The Couchbase Blog"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/bb545ebe83bb2d12f91095811d0a72e1","name":"Nic Raboy, Developer Advocate, Couchbase","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/8863514d8bed0cf6080f23db40e00354","url":"https:\/\/secure.gravatar.com\/avatar\/bedeb68368d4681aca4c74fe5f697f0c423b80d498ec50fd915ba018b72c101f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/bedeb68368d4681aca4c74fe5f697f0c423b80d498ec50fd915ba018b72c101f?s=96&d=mm&r=g","caption":"Nic Raboy, Developer Advocate, Couchbase"},"description":"Nic Raboy is an advocate of modern web and mobile development technologies. He has experience in Java, JavaScript, Golang and a variety of frameworks such as Angular, NativeScript, and Apache Cordova. Nic writes about his development experiences related to making web and mobile development easier to understand.","sameAs":["https:\/\/www.thepolyglotdeveloper.com","https:\/\/www.facebook.com\/thepolyglotdeveloper","https:\/\/x.com\/nraboy"],"url":"https:\/\/www.couchbase.com\/blog\/author\/nic-raboy-2\/"}]}},"authors":[{"term_id":9032,"user_id":63,"is_guest":0,"slug":"nic-raboy-2","display_name":"Nic Raboy, Developer Advocate, Couchbase","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/bedeb68368d4681aca4c74fe5f697f0c423b80d498ec50fd915ba018b72c101f?s=96&d=mm&r=g","author_category":"","last_name":"Raboy","first_name":"Nic","job_title":"","user_url":"https:\/\/www.thepolyglotdeveloper.com","description":"Nic Raboy is an advocate of modern web and mobile development technologies. He has experience in Java, JavaScript, Golang and a variety of frameworks such as Angular, NativeScript, and Apache Cordova. Nic writes about his development experiences related to making web and mobile development easier to understand."}],"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/2985","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/users\/63"}],"replies":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/comments?post=2985"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/2985\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/media\/13873"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/media?parent=2985"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/categories?post=2985"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/tags?post=2985"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=2985"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}