{"id":3050,"date":"2017-05-02T08:01:05","date_gmt":"2017-05-02T15:01:05","guid":{"rendered":"http:\/\/www.couchbase.com\/blog\/?p=3050"},"modified":"2023-09-11T00:22:56","modified_gmt":"2023-09-11T07:22:56","slug":"deploy-golang-web-application-couchbase-docker-containers","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/ko\/deploy-golang-web-application-couchbase-docker-containers\/","title":{"rendered":"Golang \uc6f9 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uacfc Couchbase\ub97c Docker \ucee8\ud14c\uc774\ub108\ub85c \ubc30\ud3ec\ud558\uae30"},"content":{"rendered":"<p>In my development series regarding <a href=\"https:\/\/www.docker.com\" target=\"_blank\" rel=\"noopener\">Docker<\/a> containers for the web application developer, I had already gone over deploying Java and Node.js applications as containers alongside Couchbase Server Containers. \u00a0This time around I thought it would be cool to deploy a Golang web application as a Docker container alongside <a href=\"https:\/\/www.couchbase.com\" target=\"_blank\" rel=\"noopener\">Couchbase<\/a>.<\/p>\n<p>The process is very similar to what I had already demonstrated in the previous tutorials, but it is worth exploring. \u00a0We&#8217;re going to explore containerizing an application that I had explained in a previous tutorial on the topic of URL shortening services.<\/p>\n<p><!--more--><\/p>\n<p>If you&#8217;re interested, you can check out\u00a0<a href=\"https:\/\/www.couchbase.com\/blog\/docker-deploy-containerized-java-couchbase-web-application\/\" target=\"_blank\" rel=\"noopener\">Use Docker to Deploy a Containerized Java with Couchbase Web Application<\/a> and\u00a0<a href=\"https:\/\/www.couchbase.com\/blog\/deploy-node-js-couchbase-web-application-docker-containers\/\" target=\"_blank\" rel=\"noopener\">Deploy a Node.js with Couchbase Web Application as Docker Containers<\/a>, depending on your language preferences.<\/p>\n<h2>The Requirements<\/h2>\n<p>There is only one dependency that must be met to be successful with this guide. \u00a0You need Docker installed on a host machine. \u00a0You don&#8217;t need Golang installed or Couchbase Server since that is the beauty of the Docker Engine.<\/p>\n<p>While you don&#8217;t have to, I would recommend becoming familiar with the application in question. \u00a0To learn about the code behind the application, check out the tutorial I wrote called,\u00a0<a href=\"https:\/\/www.thepolyglotdeveloper.com\/2016\/12\/create-a-url-shortener-with-golang-and-couchbase-nosql\/\" target=\"_blank\" rel=\"noopener\">Create a URL Shortener with Golang and Couchbase NoSQL<\/a>.<\/p>\n<h2>Establishing a Docker Project for the Golang Application<\/h2>\n<p>The source code to the application, and what we&#8217;ll be bundling, can be seen below. \u00a0You should save it as a Go source code file such as\u00a0<strong>main.go<\/strong>.<\/p>\n<pre class=\"lang:default highlight:0 decode:true \">package main\r\n\r\nimport (\r\n\t\"encoding\/json\"\r\n\t\"log\"\r\n\t\"net\/http\"\r\n\t\"os\"\r\n\t\"time\"\r\n\r\n\t\"github.com\/couchbase\/gocb\"\r\n\t\"github.com\/gorilla\/mux\"\r\n\t\"github.com\/speps\/go-hashids\"\r\n)\r\n\r\ntype MyUrl struct {\r\n\tID       string `json:\"id,omitempty\"`\r\n\tLongUrl  string `json:\"longUrl,omitempty\"`\r\n\tShortUrl string `json:\"shortUrl,omitempty\"`\r\n}\r\n\r\nvar bucket *gocb.Bucket\r\nvar bucketName string\r\n\r\nfunc ExpandEndpoint(w http.ResponseWriter, req *http.Request) {\r\n\tvar n1qlParams []interface{}\r\n\tquery := gocb.NewN1qlQuery(\"SELECT `\" + bucketName + \"`.* FROM `\" + bucketName + \"` WHERE shortUrl = $1\")\r\n\tparams := req.URL.Query()\r\n\tn1qlParams = append(n1qlParams, params.Get(\"shortUrl\"))\r\n\trows, _ := bucket.ExecuteN1qlQuery(query, n1qlParams)\r\n\tvar row MyUrl\r\n\trows.One(&amp;row)\r\n\tjson.NewEncoder(w).Encode(row)\r\n}\r\n\r\nfunc CreateEndpoint(w http.ResponseWriter, req *http.Request) {\r\n\tvar url MyUrl\r\n\t_ = json.NewDecoder(req.Body).Decode(&amp;url)\r\n\tvar n1qlParams []interface{}\r\n\tn1qlParams = append(n1qlParams, url.LongUrl)\r\n\tquery := gocb.NewN1qlQuery(\"SELECT `\" + bucketName + \"`.* FROM `\" + bucketName + \"` WHERE longUrl = $1\")\r\n\trows, err := bucket.ExecuteN1qlQuery(query, n1qlParams)\r\n\tif err != nil {\r\n\t\tw.WriteHeader(401)\r\n\t\tw.Write([]byte(err.Error()))\r\n\t\treturn\r\n\t}\r\n\tvar row MyUrl\r\n\trows.One(&amp;row)\r\n\tif row == (MyUrl{}) {\r\n\t\thd := hashids.NewData()\r\n\t\th := hashids.NewWithData(hd)\r\n\t\tnow := time.Now()\r\n\t\turl.ID, _ = h.Encode([]int{int(now.Unix())})\r\n\t\turl.ShortUrl = \"https:\/\/localhost:12345\/\" + url.ID\r\n\t\tbucket.Insert(url.ID, url, 0)\r\n\t} else {\r\n\t\turl = row\r\n\t}\r\n\tjson.NewEncoder(w).Encode(url)\r\n}\r\n\r\nfunc RootEndpoint(w http.ResponseWriter, req *http.Request) {\r\n\tparams := mux.Vars(req)\r\n\tvar url MyUrl\r\n\tbucket.Get(params[\"id\"], &amp;url)\r\n\thttp.Redirect(w, req, url.LongUrl, 301)\r\n}\r\n\r\nfunc main() {\r\n\trouter := mux.NewRouter()\r\n\tcluster, _ := gocb.Connect(\"couchbase:\/\/\" + os.Getenv(\"COUCHBASE_HOST\"))\r\n\tbucketName = os.Getenv(\"COUCHBASE_BUCKET\")\r\n\tbucket, _ = cluster.OpenBucket(bucketName, \"\")\r\n\trouter.HandleFunc(\"\/{id}\", RootEndpoint).Methods(\"GET\")\r\n\trouter.HandleFunc(\"\/expand\/\", ExpandEndpoint).Methods(\"GET\")\r\n\trouter.HandleFunc(\"\/create\", CreateEndpoint).Methods(\"PUT\")\r\n\tlog.Fatal(http.ListenAndServe(\":12345\", router))\r\n}<\/pre>\n<p>The only difference between the code above and the previous tutorial on the subject is the use of the\u00a0<code>os.Getenv(\"COUCHBASE_HOST\")<\/code> and\u00a0<code>os.Getenv(\"COUCHBASE_BUCKET\")<\/code> commands. \u00a0This will allow us to define the Couchbase connection information at container runtime via environment variables rather than hardcoding it into the application.<\/p>\n<p>If you had Couchbase Server running, you could launch the web application by doing:<\/p>\n<pre class=\"lang:default highlight:0 decode:true \">env COUCHBASE_HOST=localhost COUCHBASE_BUCKET=default go run *.go<\/pre>\n<p>Of course the project would need to be in your\u00a0<strong>$GOPATH<\/strong>, but it would be accessible from\u00a0<strong>https:\/\/localhost:12345<\/strong> as defined in the code.<\/p>\n<p>The goal here is not to run this project locally, but via a Docker container. \u00a0Create a\u00a0<strong>Dockerfile<\/strong> file next to the\u00a0<strong>main.go<\/strong> file or whatever you called it. \u00a0The\u00a0<strong>Dockerfile<\/strong> file should contain the following:<\/p>\n<pre class=\"lang:default highlight:0 decode:true \">FROM golang:alpine\r\n\r\nRUN apk update &amp;&amp; apk add git\r\n\r\nCOPY . \/go\/src\/app\/\r\n\r\nWORKDIR \/go\/src\/app\r\n\r\nRUN go get -d -v\r\nRUN go install -v\r\n\r\nCMD [\"app\"]<\/pre>\n<p>As a base we&#8217;ll be using the official Golang Alpine Linux image for Docker, but we&#8217;ll be customizing it. \u00a0During build time we are installing Git, copying the\u00a0<strong>main.go<\/strong> file to the image, installing the project dependencies found in the\u00a0<code>import<\/code> section, and installing the application. \u00a0At runtime we are executing the installed application.<\/p>\n<p>To build an image from our custom Docker blueprint, we would execute the following:<\/p>\n<pre class=\"lang:default highlight:0 decode:true \">docker build -t golang-project .<\/pre>\n<p>After all the compile-time steps complete we&#8217;ll be left with a\u00a0<code>golang-project<\/code> Docker image. \u00a0Before we try to run this image, we need to worry about Couchbase. \u00a0While we could run Couchbase outside a container, where is the fun in that?<\/p>\n<h2>Creating a Custom Couchbase Server Docker Image<\/h2>\n<p>Just like with Golang, an official Docker image exists for <a href=\"https:\/\/hub.docker.com\/_\/couchbase\/\" target=\"_blank\" rel=\"noopener\">Couchbase Server<\/a>. \u00a0While it is a perfectly acceptable solution, it is not an automated solution. \u00a0This means that you&#8217;ll have to manually configure the database after the container starts. \u00a0We probably want to avoid that.<\/p>\n<p>Instead, create a directory somewhere on your computer with a\u00a0<strong>Dockerfile<\/strong> file and\u00a0<strong>configure.sh<\/strong> file in it. \u00a0The plan is to create a Docker blueprint that will execute the configuration script for us.<\/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>We&#8217;re basically just copying the script into the base image and running it. \u00a0The real magic happens inside of the 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>Couchbase Server has a RESTful interface which will allow us to complete the configuration wizard through a script. \u00a0The above commands will define instance specs and services, administrative credentials, and a Bucket.<\/p>\n<p>You&#8217;ll notice things like <code>$COUCHBASE_ADMINISTRATOR_USERNAME<\/code> within the script. \u00a0Just like in the Golang application we are leveraging environment variables to prevent having to hardcode values into our image. \u00a0These values can be defined during the container deployment.<\/p>\n<p>More information on provisioning a Couchbase Server container can be found in a <a href=\"https:\/\/www.thepolyglotdeveloper.com\/2017\/04\/using-couchbase-docker-deploying-containerized-nosql-cluster\/\" target=\"_blank\" rel=\"noopener\">previous article<\/a> that I wrote on the subject.<\/p>\n<p>Finally we can build this custom Couchbase Server image. \u00a0From the Docker Shell, execute the following:<\/p>\n<pre class=\"lang:default highlight:0 decode:true \">docker build -t couchbase-custom .<\/pre>\n<p>The above command will leave us with a\u00a0<code>couchbase-custom<\/code> image.<\/p>\n<h2>Deploying the Containerized Microservice<\/h2>\n<p>There are a few ways to deploy the images that we built. \u00a0We&#8217;ll explore two of them here.<\/p>\n<p>Given\u00a0what we know about our images, we can deploy our containers with the following commands:<\/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\n    couchbase-custom<\/pre>\n<p>The above command will deploy Couchbase Server while mapping the necessary ports to the host operating system. \u00a0We&#8217;re passing each environment variable in with the command and defining an operating network. \u00a0The network is important because you want both your database and application to be on the same container network.<\/p>\n<pre class=\"lang:default highlight:0 decode:true \">docker run -d \\\r\n    -p 12345:12345 \\\r\n    -e COUCHBASE_HOST=couchbase \\\r\n    -e COUCHBASE_BUCKET=default \\\r\n    --network=\"docker_default\" \\\r\n    --name golang \r\n    golang-project<\/pre>\n<p>The above command will deploy our Golang image while mapping the correct ports again. \u00a0For the host you&#8217;ll notice that we&#8217;re using\u00a0<code>couchbase<\/code> which is actually the name of our other container. \u00a0The container names also act as host names.<\/p>\n<p>The commands you just saw are a very manual way to do things in my opinion. \u00a0Instead you can create a <a href=\"https:\/\/www.couchbase.com\/blog\/couchbase-using-docker-compose\/\">Docker Compose<\/a> file to handle this for you.<\/p>\n<p>Create a\u00a0<strong>docker-compose.yml<\/strong> file somewhere on your computer with 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    golang:\r\n        image: golang-project\r\n        ports:\r\n            - 12345:12345\r\n        environment:\r\n            - COUCHBASE_HOST=couchbase\r\n            - COUCHBASE_BUCKET=default\r\n        restart: always<\/pre>\n<p>Everything in a Compose file will be on the same network. \u00a0To deploy each service, execute the following:<\/p>\n<pre class=\"lang:default highlight:0 decode:true\">docker-compose run -d --service-ports couchbase\r\ndocker-compose run -d --service-ports golang<\/pre>\n<p>If you&#8217;re familiar with Docker Compose you&#8217;ll be familiar with\u00a0<code>docker-compose up<\/code>, but we can&#8217;t use that here. \u00a0Couchbase Server doesn&#8217;t have a mechanism to tell us it is ready, so we don&#8217;t want the Golang application to try to connect before it is configured. \u00a0Definitely not a big deal when it comes to container deployment.<\/p>\n<h2>Conclusion<\/h2>\n<p>You just saw how to create a Golang microservice as a <a href=\"https:\/\/www.docker.com\" target=\"_blank\" rel=\"noopener\">Docker<\/a> container that communicates to Couchbase Server, also running within a Docker container. \u00a0By turning your application into a Docker image it becomes very easy to distribute because you won&#8217;t have to worry about the environment you&#8217;re trying to deploy to. \u00a0As long as the Docker Engine is available you can deploy your application. \u00a0A useful example of this would be in <a href=\"https:\/\/www.thepolyglotdeveloper.com\/2017\/04\/continuous-deployment-of-web-application-containers-with-jenkins-and-docker\/\" target=\"_blank\" rel=\"noopener\">continuous deployment of containers<\/a> using Jenkins.<\/p>\n<p>Want to see how to containerize your Java application? \u00a0Check out <a href=\"https:\/\/www.couchbase.com\/blog\/docker-deploy-containerized-java-couchbase-web-application\/\" target=\"_blank\" rel=\"noopener\">this tutorial<\/a> I wrote. \u00a0I also have a tutorial for containerizing a Node.js application <a href=\"https:\/\/www.couchbase.com\/blog\/deploy-node-js-couchbase-web-application-docker-containers\/\" target=\"_blank\" rel=\"noopener\">here<\/a>.<\/p>\n<p>Want more information on using Golang with Couchbase? Check out the <a href=\"https:\/\/www.couchbase.com\/developers\/\" target=\"_blank\" rel=\"noopener\">Couchbase Developer Portal<\/a> for documentation and examples.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In my development series regarding Docker containers for the web application developer, I had already gone over deploying Java and Node.js applications as containers alongside Couchbase Server Containers. \u00a0This time around I thought it would be cool to deploy a [&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,1820],"tags":[1554,1519,1923,1776],"ppma_author":[9032],"class_list":["post-3050","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-best-practices-and-tutorials","category-couchbase-server","category-golang","tag-container","tag-docker","tag-docker-containers","tag-web-application"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.3 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Deploy a Golang Web Application and Couchbase as Docker Containers<\/title>\n<meta name=\"description\" content=\"Learn how to containerize and deploy your Golang web applications and Couchbase Server NoSQL database nodes as Docker containers.\" \/>\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\/ko\/deploy-golang-web-application-couchbase-docker-containers\/\" \/>\n<meta property=\"og:locale\" content=\"ko_KR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Deploy a Golang Web Application and Couchbase as Docker Containers\" \/>\n<meta property=\"og:description\" content=\"Learn how to containerize and deploy your Golang web applications and Couchbase Server NoSQL database nodes as Docker containers.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/ko\/deploy-golang-web-application-couchbase-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-05-02T15:01:05+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-09-11T07:22:56+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=\"5\ubd84\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/deploy-golang-web-application-couchbase-docker-containers\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/deploy-golang-web-application-couchbase-docker-containers\\\/\"},\"author\":{\"name\":\"Nic Raboy, Developer Advocate, Couchbase\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#\\\/schema\\\/person\\\/bb545ebe83bb2d12f91095811d0a72e1\"},\"headline\":\"Deploy a Golang Web Application and Couchbase as Docker Containers\",\"datePublished\":\"2017-05-02T15:01:05+00:00\",\"dateModified\":\"2023-09-11T07:22:56+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/deploy-golang-web-application-couchbase-docker-containers\\\/\"},\"wordCount\":1107,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/deploy-golang-web-application-couchbase-docker-containers\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/1\\\/2022\\\/11\\\/couchbase-nosql-dbaas.png\",\"keywords\":[\"container\",\"docker\",\"docker containers\",\"web application\"],\"articleSection\":[\"Best Practices and Tutorials\",\"Couchbase Server\",\"GoLang\"],\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/deploy-golang-web-application-couchbase-docker-containers\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/deploy-golang-web-application-couchbase-docker-containers\\\/\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/deploy-golang-web-application-couchbase-docker-containers\\\/\",\"name\":\"Deploy a Golang Web Application and Couchbase as Docker Containers\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/deploy-golang-web-application-couchbase-docker-containers\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/deploy-golang-web-application-couchbase-docker-containers\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/1\\\/2022\\\/11\\\/couchbase-nosql-dbaas.png\",\"datePublished\":\"2017-05-02T15:01:05+00:00\",\"dateModified\":\"2023-09-11T07:22:56+00:00\",\"description\":\"Learn how to containerize and deploy your Golang web applications and Couchbase Server NoSQL database nodes as Docker containers.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/deploy-golang-web-application-couchbase-docker-containers\\\/#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/deploy-golang-web-application-couchbase-docker-containers\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/deploy-golang-web-application-couchbase-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-golang-web-application-couchbase-docker-containers\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Deploy a Golang Web Application and Couchbase as Docker Containers\"}]},{\"@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\":\"ko-KR\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#organization\",\"name\":\"The Couchbase Blog\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@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\":\"ko-KR\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/bedeb68368d4681aca4c74fe5f697f0c423b80d498ec50fd915ba018b72c101f?s=96&d=mm&r=g8863514d8bed0cf6080f23db40e00354\",\"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\\\/ko\\\/author\\\/nic-raboy-2\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Golang \uc6f9 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uacfc Couchbase\ub97c Docker \ucee8\ud14c\uc774\ub108\ub85c \ubc30\ud3ec\ud558\uae30","description":"Golang \uc6f9 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uacfc Couchbase Server NoSQL \ub370\uc774\ud130\ubca0\uc774\uc2a4 \ub178\ub4dc\ub97c \ucee8\ud14c\uc774\ub108\ud654\ud558\uc5ec Docker \ucee8\ud14c\uc774\ub108\ub85c \ubc30\ud3ec\ud558\ub294 \ubc29\ubc95\uc744 \uc54c\uc544\ubcf4\uc138\uc694.","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\/ko\/deploy-golang-web-application-couchbase-docker-containers\/","og_locale":"ko_KR","og_type":"article","og_title":"Deploy a Golang Web Application and Couchbase as Docker Containers","og_description":"Learn how to containerize and deploy your Golang web applications and Couchbase Server NoSQL database nodes as Docker containers.","og_url":"https:\/\/www.couchbase.com\/blog\/ko\/deploy-golang-web-application-couchbase-docker-containers\/","og_site_name":"The Couchbase Blog","article_author":"https:\/\/www.facebook.com\/thepolyglotdeveloper","article_published_time":"2017-05-02T15:01:05+00:00","article_modified_time":"2023-09-11T07:22:56+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":"5\ubd84"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/deploy-golang-web-application-couchbase-docker-containers\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/deploy-golang-web-application-couchbase-docker-containers\/"},"author":{"name":"Nic Raboy, Developer Advocate, Couchbase","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/bb545ebe83bb2d12f91095811d0a72e1"},"headline":"Deploy a Golang Web Application and Couchbase as Docker Containers","datePublished":"2017-05-02T15:01:05+00:00","dateModified":"2023-09-11T07:22:56+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/deploy-golang-web-application-couchbase-docker-containers\/"},"wordCount":1107,"commentCount":0,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/deploy-golang-web-application-couchbase-docker-containers\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","keywords":["container","docker","docker containers","web application"],"articleSection":["Best Practices and Tutorials","Couchbase Server","GoLang"],"inLanguage":"ko-KR","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.couchbase.com\/blog\/deploy-golang-web-application-couchbase-docker-containers\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/deploy-golang-web-application-couchbase-docker-containers\/","url":"https:\/\/www.couchbase.com\/blog\/deploy-golang-web-application-couchbase-docker-containers\/","name":"Golang \uc6f9 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uacfc Couchbase\ub97c Docker \ucee8\ud14c\uc774\ub108\ub85c \ubc30\ud3ec\ud558\uae30","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/deploy-golang-web-application-couchbase-docker-containers\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/deploy-golang-web-application-couchbase-docker-containers\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","datePublished":"2017-05-02T15:01:05+00:00","dateModified":"2023-09-11T07:22:56+00:00","description":"Golang \uc6f9 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uacfc Couchbase Server NoSQL \ub370\uc774\ud130\ubca0\uc774\uc2a4 \ub178\ub4dc\ub97c \ucee8\ud14c\uc774\ub108\ud654\ud558\uc5ec Docker \ucee8\ud14c\uc774\ub108\ub85c \ubc30\ud3ec\ud558\ub294 \ubc29\ubc95\uc744 \uc54c\uc544\ubcf4\uc138\uc694.","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/deploy-golang-web-application-couchbase-docker-containers\/#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/deploy-golang-web-application-couchbase-docker-containers\/"]}]},{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/www.couchbase.com\/blog\/deploy-golang-web-application-couchbase-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-golang-web-application-couchbase-docker-containers\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Deploy a Golang Web Application and Couchbase as Docker Containers"}]},{"@type":"WebSite","@id":"https:\/\/www.couchbase.com\/blog\/#website","url":"https:\/\/www.couchbase.com\/blog\/","name":"\uce74\uc6b0\uce58\ubca0\uc774\uc2a4 \ube14\ub85c\uadf8","description":"NoSQL \ub370\uc774\ud130\ubca0\uc774\uc2a4, Couchbase","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":"ko-KR"},{"@type":"Organization","@id":"https:\/\/www.couchbase.com\/blog\/#organization","name":"\uce74\uc6b0\uce58\ubca0\uc774\uc2a4 \ube14\ub85c\uadf8","url":"https:\/\/www.couchbase.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"ko-KR","@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, \uac1c\ubc1c\uc790 \uc639\ud638\uc790, Couchbase","image":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/secure.gravatar.com\/avatar\/bedeb68368d4681aca4c74fe5f697f0c423b80d498ec50fd915ba018b72c101f?s=96&d=mm&r=g8863514d8bed0cf6080f23db40e00354","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":"\ub2c9 \ub77c\ubcf4\uc774\ub294 \ucd5c\uc2e0 \uc6f9 \ubc0f \ubaa8\ubc14\uc77c \uac1c\ubc1c \uae30\uc220\uc744 \uc639\ud638\ud558\ub294 \uc0ac\ub78c\uc785\ub2c8\ub2e4. \uadf8\ub294 Java, JavaScript, Golang \ubc0f Angular, NativeScript, Apache Cordova\uc640 \uac19\uc740 \ub2e4\uc591\ud55c \ud504\ub808\uc784\uc6cc\ud06c\uc5d0 \ub300\ud55c \uacbd\ud5d8\uc774 \uc788\uc2b5\ub2c8\ub2e4. Nic\uc740 \uc6f9 \ubc0f \ubaa8\ubc14\uc77c \uac1c\ubc1c\uc744 \ubcf4\ub2e4 \uc27d\uac8c \uc774\ud574\ud560 \uc218 \uc788\ub3c4\ub85d \uc790\uc2e0\uc758 \uac1c\ubc1c \uacbd\ud5d8\uc5d0 \ub300\ud574 \uae00\uc744 \uc4f0\uace0 \uc788\uc2b5\ub2c8\ub2e4.","sameAs":["https:\/\/www.thepolyglotdeveloper.com","https:\/\/www.facebook.com\/thepolyglotdeveloper","https:\/\/x.com\/nraboy"],"url":"https:\/\/www.couchbase.com\/blog\/ko\/author\/nic-raboy-2\/"}]}},"acf":[],"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","0":null,"1":"","2":"","3":"","4":"","5":"","6":"","7":"","8":""}],"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/posts\/3050","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/users\/63"}],"replies":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/comments?post=3050"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/posts\/3050\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/media\/13873"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/media?parent=3050"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/categories?post=3050"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/tags?post=3050"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/ppma_author?post=3050"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}