{"id":13014,"date":"2024-12-23T10:07:19","date_gmt":"2024-12-23T10:07:19","guid":{"rendered":"https:\/\/cloudkul.com\/blog\/?p=13014"},"modified":"2024-12-23T10:07:21","modified_gmt":"2024-12-23T10:07:21","slug":"how-to-host-website-on-docker-container","status":"publish","type":"post","link":"https:\/\/cloudkul.com\/blog\/how-to-host-website-on-docker-container\/","title":{"rendered":"How To Host Website On Docker Container"},"content":{"rendered":"\n<p>A docker container is a standard unit of software that packages up code and all its dependencies so that the application can run quickly from one computing environment to another.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-style-default\"><a href=\"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2023\/02\/how-to-host-website-on-docker-container.webp\"><img data-dominant-color=\"4478df\" data-has-transparency=\"false\" style=\"--dominant-color: #4478df;\" loading=\"lazy\" decoding=\"async\" width=\"1200\" height=\"600\" src=\"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2023\/02\/how-to-host-website-on-docker-container.webp\" alt=\"docker\" class=\"not-transparent wp-image-19171\"\/><\/a><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Host App\/Website On Docker Container<\/h2>\n\n\n\n<p><strong>First, We have to create a Dockerfile for building an image for our website hosting.<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>FROM ubuntu:20.04\nENV TZ=Asia\/Kolkata\n\nMAINTAINER Sarthak-Dixit\n\nRUN apt-get update -y \\\n&amp;&amp; apt-get install tzdata \\\n&amp;&amp; apt-get install -y apache2 wget curl \\\n&amp;&amp; apt-get install -y unzip sed\\\n&amp;&amp; a2enmod rewrite \\\n&amp;&amp; export LANG=en_US.UTF-8 \\\n&amp;&amp; apt-get install -y software-properties-common \\\n&amp;&amp; apt-get install -y language-pack-en-base \\\n&amp;&amp; add-apt-repository ppa:ondrej\/php -y\\\n&amp;&amp; apt-get update -y \\\n&amp;&amp; apt-get install -y php8.1 php8.1-mysql php8.1-bcmath php8.1-gd php8.1-bz2 php8.1-xml php8.1-cli php8.1-common php8.1-intl php8.1-curl php8.1-zip php8.1-mbstring php8.1-soap libapache2-mod-php8.1 \\\n&amp;&amp; rm \/var\/www\/html\/* \\\n&amp;&amp; wget https:\/\/wordpress.org\/latest.zip \\\n&amp;&amp; unzip latest.zip \\\n&amp;&amp; mv wordpress\/* \/var\/www\/html \\\n&amp;&amp; cd \/var\/www\/html \\\n&amp;&amp; cp wp-config-sample.php wp-config.php \\\n&amp;&amp; sed -i -e 's\/database_name_here\/wordpress\/g' \/var\/www\/html\/wp-config.php \\\n&amp;&amp; sed -i -e 's\/username_here\/root\/g' \/var\/www\/html\/wp-config.php \\\n&amp;&amp; sed -i -e 's\/password_here\/qwerty\/g' \/var\/www\/html\/wp-config.php \\\n&amp;&amp; sed -i -e 's\/localhost\/mysql\/g' \/var\/www\/html\/wp-config.php\n\nEXPOSE 80\n\nRUN apt-get install -y supervisor \\\n&amp;&amp; mkdir -p \/var\/log\/supervisor\nenv APACHE_RUN_USER www-data\nenv APACHE_RUN_GROUP www-data\nenv APACHE_PID_FILE \/var\/run\/apache2.pid\nenv APACHE_RUN_DIR \/var\/run\/apache2\nenv APACHE_LOCK_DIR \/var\/lock\/apache2\nenv APACHE_LOG_DIR \/var\/log\/apache2\n\nCOPY supervisord.conf \/etc\/supervisor\/conf.d\/\n\nWORKDIR \/var\/www\/html\n\nCMD &#91;\"\/usr\/bin\/supervisord\"]\n<\/code><\/pre>\n\n\n\n<p>Copy the code and save it as a file name of Dockerfile with your file editor.<\/p>\n\n\n\n<p>Secondly, create a supervisor configuration file. <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;supervisord]\nnodaemon=true\n\n&#91;program:apache2]\ncommand=\/bin\/bash -c \"source \/etc\/apache2\/envvars &amp;&amp; exec \/usr\/sbin\/apache2 -DFOREGROUND\"<\/code><\/pre>\n\n\n\n<p>Copy the code and save it as file-name of supervisord.conf with your file editor.<\/p>\n\n\n\n<p><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-black-color\"><strong>Note: <\/strong>The file &#8220;supervisord.conf&#8221; is required to start the web-server service in the container and we can use this file to start other services as well.  <\/mark><\/p>\n\n\n\n<p>Now<strong>,<\/strong> We are building a <a href=\"https:\/\/cloudkul.com\/blog\/understanding-docker-images-and-containers\/\">docker image<\/a> by using the above-created Dockerfile.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ docker build -t wp-image <\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>The above command builds an image with the name wp-image. You can list all your docker images by using the command &#8220;docker images&#8221;.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>After building the image, We have to run the build image on the container<strong>.<\/strong><\/p>\n\n\n\n<p>Firstly, We run a MySQL container to store the database.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote\">\n<pre class=\"wp-block-code\"><code>$ docker run -d --name mysql-cont -e MYSQL_ROOT_PASSWORD=qwerty -e MYSQL_DATABASE=wordpress mysql:5.7<\/code><\/pre>\n<\/blockquote>\n\n\n\n<p><\/p>\n\n\n\n<p>And in the above command, We run the container with a detached terminal by &#8220;-d&#8221;, name of &#8220;mysql-cont&#8221; by using &#8220;&#8211;name&#8221;<\/p>\n\n\n\n<p>Create a database by using &#8220;<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-luminous-vivid-orange-color\"> <\/mark>-e MYSQL_DATABASE=wordpress&#8221;<\/p>\n\n\n\n<p>Configure password in mysql root user by &#8220;-e MYSQL_ROOT_PASSWORD=&#8221; and using mysql:5.7 image in which &#8220;mysql&#8221; is the image name and &#8220;:5.7&#8221; is the version tag.<\/p>\n\n\n\n<p>Then, We run a container of our build image.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote\">\n<pre class=\"wp-block-code\"><code>$ docker run -dit --name wordpress --link mysql-cont:mysql -p 8080:80 wp-image<\/code><\/pre>\n<\/blockquote>\n\n\n\n<p>In this command, Everything is the same as have we run the previous command of MySQL container except &#8220;&#8211;link&#8221;, &#8220;-it&#8221; and &#8220;-p&#8221;.<\/p>\n\n\n\n<p>Here, &#8220;-it&#8221; means instruct docker to give terminal interaction to the container.<\/p>\n\n\n\n<p>For creating links between containers, We use &#8220;&#8211;link&#8221; to link the WordPress container to the MySQL container for sharing resources of the database container.<\/p>\n\n\n\n<p>In porting while running a container we use  &#8220;-p&#8221; to attach the external port to the container&#8217;s port.<\/p>\n\n\n\n<p>8080 &#8212; refers base machine&#8217;s port.<br>80 &#8212; refers container&#8217;s port.<\/p>\n\n\n\n<p>After all the above processes, you will be able to browse the website at http:\/\/localhost:8080.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong><span style=\"text-decoration: underline\">Dockerfile<\/span><\/strong><\/h2>\n\n\n\n<p>A docker file is&nbsp;<strong>a text file that includes all the commands a user can call on the command line to bring together an image<\/strong>.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-black-color\"><strong><span style=\"text-decoration: underline\">Commands Use In Dockerfile Environment<\/span><\/strong><\/mark><\/h3>\n\n\n\n<p><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-black-color\">FROM<\/mark> &#8212; <\/strong>Uses for fetching and using images from the base machine if present, otherwise, it will get it from the docker registry. <\/p>\n\n\n\n<p><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-black-color\">RUN<\/mark> &#8212;<\/strong> For running commands in shell form over the image. <\/p>\n\n\n\n<p><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-black-color\">CMD<\/mark> &#8212; <\/strong>Use to execute the command and It will be written in an executable set as [parameter-1, parameter-2].<\/p>\n\n\n\n<p><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-black-color\">MAINTAINER<\/mark> &#8212; <\/strong>Use for maintaining Dockerfile author.<\/p>\n\n\n\n<p><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-black-color\">EXPOSE<\/mark> &#8212; <\/strong>For exposing the port of the image.<\/p>\n\n\n\n<p><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-black-color\">WORKDIR<\/mark>  &#8212; <\/strong>For setting the working directory of the image.<\/p>\n\n\n\n<p><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-black-color\">ADD<\/mark> &#8212; <\/strong>Use for copying our local machine data to docker image as well as use URL to copy and extract tar directory from source to destination.<\/p>\n\n\n\n<p><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-black-color\">COPY<\/mark> &#8212;<\/strong> For copying our local machine&#8217;s data to the docker image.<\/p>\n\n\n\n<p><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-black-color\">env<\/mark> &#8212; <\/strong>For setting the environment in the docker image.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">IP Allocation To Container\/Assign Static IP To Docker Container<\/h2>\n\n\n\n<p>First, we have to create a network on docker.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote\">\n<pre class=\"wp-block-code\"><code>$ docker network create --subnet=10.6.0.0\/16 mynetwork<\/code><\/pre>\n<\/blockquote>\n\n\n\n<p>And then, we run our container by using this network and assigning the static IP.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote\">\n<pre class=\"wp-block-code\"><code>$ docker -d run --net mynetwork --ip 10.6.0.1 -p 8080:80 --name server wp-image<\/code><\/pre>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\">Communication between docker containers<\/h2>\n\n\n\n<p>A bridge network is an easy and default way to communicate between containers. Containers which is under the same bridge network will able to communicate by name or alias.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote\">\n<pre class=\"wp-block-code\"><code>$ docker network ls<\/code><\/pre>\n<\/blockquote>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-cloudkul wp-block-embed-cloudkul\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"izxU7RaNJ9\"><a href=\"https:\/\/cloudkul.com\/blog\/start-your-journey-with-docker\/\">Start your journey with Docker&#8230;.!!!<\/a><\/blockquote><iframe class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8220;Start your journey with Docker&#8230;.!!!&#8221; &#8212; Cloudkul\" src=\"https:\/\/cloudkul.com\/blog\/start-your-journey-with-docker\/embed\/#?secret=ZuWKJCRCYl#?secret=izxU7RaNJ9\" data-secret=\"izxU7RaNJ9\" width=\"500\" height=\"282\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>By using the above command, you will able to list the docker network which includes Network ID, Network Name, Driver, and Scope.<\/p>\n\n\n\n<p><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-black-color\"><strong>Note:<\/strong> The container&#8217;s communication is based on IP within the same network of the bridge and also by name or alias of the container. <\/mark><\/p>\n\n\n\n<p><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-black-color\">This is the default way to communicate or connect between containers within the default bridge.<\/mark><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong><span style=\"text-decoration: underline\">User Defined Docker Network<\/span><\/strong><\/h3>\n\n\n\n<blockquote class=\"wp-block-quote\">\n<pre class=\"wp-block-code\"><code>$ docker network create Bnet\n\n$ docker run --net Bnet -p 80:8080 --name server ubuntu\/apache2\n\n$ docker run --net Bnet -p 8080:8080 --name ubuntu-server wp-image<\/code><\/pre>\n<\/blockquote>\n\n\n\n<p>In the first command, We are creating a network in the docker network as default with a bridge network using the name &#8220;Bnet&#8221;.<\/p>\n\n\n\n<p>In the second and third commands, We are creating a container under the &#8220;Bnet&#8221; network.<\/p>\n\n\n\n<p>The container of php:8.0-apache and wp-image will communicate because of containers within a user-defined bridge network.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong><span style=\"text-decoration: underline\">Docker Volume<\/span><\/strong><\/h3>\n\n\n\n<p>Let&#8217;s create a docker volume for persisting container data. So, We are going to create a volume to save MySQL data.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote\">\n<pre class=\"wp-block-code\"><code>$ docker volume create mysql-data<\/code><\/pre>\n<\/blockquote>\n\n\n\n<p>We are going to use the created volume to save data while starting a container of the &#8220;mysql:5.7&#8221; image.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote\">\n<pre class=\"wp-block-code\"><code>$ docker run -d --name mysql-cont -v mysql-data:\/var\/lib\/mysql -e MYSQL_ROOT_PASSWORD=qwerty mysql:5.7<\/code><\/pre>\n<\/blockquote>\n\n\n\n<p>After using the persisting volume &#8220;-v mysql-data:\/var\/lib\/mysql&#8221;, the Data of MySQL will be saved in &#8220;mysql-data&#8221; docker volume.<\/p>\n\n\n\n<p>If you are not using the attribute &#8220;-v&#8221; to create a docker volume, Docker will create a volume for your container. <\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong><span style=\"text-decoration: underline\">Mount Directory To Docker Container<\/span><\/strong><\/h3>\n\n\n\n<p>By default, docker will create volume when you run the container by using an attribute with &#8220;-v xyz:\/path&#8221;. Here &#8220;xyz&#8221; is the volume of the docker created during the docker run with &#8220;-v&#8221; attribute. <\/p>\n\n\n\n<p>If you use &#8220;-v \/path-of-local-directory:\/path-of-container-directory&#8221; then it mounts and persists data on the base machine&#8217;s directory to the container&#8217;s directory.<\/p>\n\n\n\n<p>You can display a list of docker volumes by the following command :<\/p>\n\n\n\n<blockquote class=\"wp-block-quote\">\n<pre class=\"wp-block-code\"><code>$ docker volume ls<\/code><\/pre>\n<\/blockquote>\n\n\n\n<p>If you want docker volume details then you will display them by inspecting that volume using the following command :<\/p>\n\n\n\n<blockquote class=\"wp-block-quote\">\n<pre class=\"wp-block-code\"><code>$ docker volume inspect &lt;volume-name&gt; <\/code><\/pre>\n<\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Why do we need persistent volume?<\/strong><\/h3>\n\n\n\n<p>We need persistent volume to protect the data loss if the containers get destroyed or crash. <\/p>\n\n\n\n<p>Therefore, the data will remain safe in the base machine even if the container gets destroyed because of the persisting volume and mount directory.<\/p>\n\n\n\n<p><strong>You may also visit our Magento development services and quality&nbsp;<\/strong> <strong><a href=\"https:\/\/store.webkul.com\/Magento-2.html\">Magento 2 Extensions<\/a><\/strong>.<\/p>\n\n\n\n<p><strong>For further help or queries, please&nbsp;<a href=\"https:\/\/cloudkul.com\/contact\/\">contact<\/a>&nbsp;us or raise a&nbsp;<a href=\"https:\/\/webkul.uvdesk.com\/en\/customer\/create-ticket\/\">ticket<\/a>.<\/strong><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>A docker container is a standard unit of software that packages up code and all <a class=\"text-primary\" title=\"read more\" href=\"https:\/\/cloudkul.com\/blog\/how-to-host-website-on-docker-container\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":40,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[2,35,87,46,341,340,36],"tags":[3,37,5,818,618,817],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How To Host Website On Docker Container - Cloudkul Website On Docker Container<\/title>\n<meta name=\"description\" content=\"A docker container is a standard unit of software that packages up code and all its dependencies so that the application can run quickly from one computing environment to another.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/cloudkul.com\/blog\/how-to-host-website-on-docker-container\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How To Host Website On Docker Container - Cloudkul Website On Docker Container\" \/>\n<meta property=\"og:description\" content=\"A docker container is a standard unit of software that packages up code and all its dependencies so that the application can run quickly from one computing environment to another.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/cloudkul.com\/blog\/how-to-host-website-on-docker-container\/\" \/>\n<meta property=\"og:site_name\" content=\"Cloudkul\" \/>\n<meta property=\"article:published_time\" content=\"2024-12-23T10:07:19+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-12-23T10:07:21+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2023\/02\/how-to-host-website-on-docker-container.webp\" \/>\n<meta name=\"author\" content=\"Sarthak Dixit\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/cloudkul.com\/blog\/how-to-host-website-on-docker-container\/\",\"url\":\"https:\/\/cloudkul.com\/blog\/how-to-host-website-on-docker-container\/\",\"name\":\"How To Host Website On Docker Container - Cloudkul Website On Docker Container\",\"isPartOf\":{\"@id\":\"https:\/\/cloudkul.com\/blog\/#website\"},\"datePublished\":\"2024-12-23T10:07:19+00:00\",\"dateModified\":\"2024-12-23T10:07:21+00:00\",\"author\":{\"@id\":\"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/d70c0690be3b2dc2cb3b82c87f774396\"},\"description\":\"A docker container is a standard unit of software that packages up code and all its dependencies so that the application can run quickly from one computing environment to another.\",\"breadcrumb\":{\"@id\":\"https:\/\/cloudkul.com\/blog\/how-to-host-website-on-docker-container\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/cloudkul.com\/blog\/how-to-host-website-on-docker-container\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/cloudkul.com\/blog\/how-to-host-website-on-docker-container\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/cloudkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How To Host Website On Docker Container\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/cloudkul.com\/blog\/#website\",\"url\":\"https:\/\/cloudkul.com\/blog\/\",\"name\":\"Cloudkul\",\"description\":\"Host your eCommerce Store on AWS with Optimized Performance\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/cloudkul.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/d70c0690be3b2dc2cb3b82c87f774396\",\"name\":\"Sarthak Dixit\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/1147bc092d035a4357905655616aeb3c?s=96&d=https%3A%2F%2Fs.gravatar.com%2Favatar%2F6148c37469011bc2f8e491ca8f5de495%3Fs%3D80&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/1147bc092d035a4357905655616aeb3c?s=96&d=https%3A%2F%2Fs.gravatar.com%2Favatar%2F6148c37469011bc2f8e491ca8f5de495%3Fs%3D80&r=g\",\"caption\":\"Sarthak Dixit\"},\"url\":\"https:\/\/cloudkul.com\/blog\/author\/sarthakdixit-cloud642\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How To Host Website On Docker Container - Cloudkul Website On Docker Container","description":"A docker container is a standard unit of software that packages up code and all its dependencies so that the application can run quickly from one computing environment to another.","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:\/\/cloudkul.com\/blog\/how-to-host-website-on-docker-container\/","og_locale":"en_US","og_type":"article","og_title":"How To Host Website On Docker Container - Cloudkul Website On Docker Container","og_description":"A docker container is a standard unit of software that packages up code and all its dependencies so that the application can run quickly from one computing environment to another.","og_url":"https:\/\/cloudkul.com\/blog\/how-to-host-website-on-docker-container\/","og_site_name":"Cloudkul","article_published_time":"2024-12-23T10:07:19+00:00","article_modified_time":"2024-12-23T10:07:21+00:00","og_image":[{"url":"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2023\/02\/how-to-host-website-on-docker-container.webp"}],"author":"Sarthak Dixit","twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/cloudkul.com\/blog\/how-to-host-website-on-docker-container\/","url":"https:\/\/cloudkul.com\/blog\/how-to-host-website-on-docker-container\/","name":"How To Host Website On Docker Container - Cloudkul Website On Docker Container","isPartOf":{"@id":"https:\/\/cloudkul.com\/blog\/#website"},"datePublished":"2024-12-23T10:07:19+00:00","dateModified":"2024-12-23T10:07:21+00:00","author":{"@id":"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/d70c0690be3b2dc2cb3b82c87f774396"},"description":"A docker container is a standard unit of software that packages up code and all its dependencies so that the application can run quickly from one computing environment to another.","breadcrumb":{"@id":"https:\/\/cloudkul.com\/blog\/how-to-host-website-on-docker-container\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/cloudkul.com\/blog\/how-to-host-website-on-docker-container\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/cloudkul.com\/blog\/how-to-host-website-on-docker-container\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/cloudkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How To Host Website On Docker Container"}]},{"@type":"WebSite","@id":"https:\/\/cloudkul.com\/blog\/#website","url":"https:\/\/cloudkul.com\/blog\/","name":"Cloudkul","description":"Host your eCommerce Store on AWS with Optimized Performance","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/cloudkul.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/d70c0690be3b2dc2cb3b82c87f774396","name":"Sarthak Dixit","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/1147bc092d035a4357905655616aeb3c?s=96&d=https%3A%2F%2Fs.gravatar.com%2Favatar%2F6148c37469011bc2f8e491ca8f5de495%3Fs%3D80&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/1147bc092d035a4357905655616aeb3c?s=96&d=https%3A%2F%2Fs.gravatar.com%2Favatar%2F6148c37469011bc2f8e491ca8f5de495%3Fs%3D80&r=g","caption":"Sarthak Dixit"},"url":"https:\/\/cloudkul.com\/blog\/author\/sarthakdixit-cloud642\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/posts\/13014"}],"collection":[{"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/users\/40"}],"replies":[{"embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/comments?post=13014"}],"version-history":[{"count":338,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/posts\/13014\/revisions"}],"predecessor-version":[{"id":19176,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/posts\/13014\/revisions\/19176"}],"wp:attachment":[{"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/media?parent=13014"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/categories?post=13014"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/tags?post=13014"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}