<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by VISHAL V NAIR on Medium]]></title>
        <description><![CDATA[Stories by VISHAL V NAIR on Medium]]></description>
        <link>https://medium.com/@vishalvnair124?source=rss-54c0fd147dd1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*TiQC7s80r-GaqPhW2LzBkw.png</url>
            <title>Stories by VISHAL V NAIR on Medium</title>
            <link>https://medium.com/@vishalvnair124?source=rss-54c0fd147dd1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 20:28:33 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@vishalvnair124/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Bucket Police]]></title>
            <link>https://medium.com/@vishalvnair124/bucket-police-6a5128be4547?source=rss-54c0fd147dd1------2</link>
            <guid isPermaLink="false">https://medium.com/p/6a5128be4547</guid>
            <category><![CDATA[aws-lambda]]></category>
            <dc:creator><![CDATA[VISHAL V NAIR]]></dc:creator>
            <pubDate>Fri, 09 May 2025 06:33:51 GMT</pubDate>
            <atom:updated>2025-05-09T06:35:34.626Z</atom:updated>
            <content:encoded><![CDATA[<p>{<br> “Version”: “2012–10–17”,<br> “Statement”: [<br> {<br> “Sid”: “PublicReadGetObject”,<br> “Effect”: “Allow”,<br> “Principal”: “*”,<br> “Action”: “s3:GetObject”,<br> “Resource”: “arn:aws:s3:::bucketname/*”<br> }<br> ]<br>}</p><p>scp -i “vishal-key.pem” script.py ec2-user@3.120.45.67:/home/ec2-user/</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6a5128be4547" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[STEP 1: Upload .py File to S3 Bucket]]></title>
            <link>https://medium.com/@vishalvnair124/step-1-upload-py-file-to-s3-bucket-ef0b4ea299f3?source=rss-54c0fd147dd1------2</link>
            <guid isPermaLink="false">https://medium.com/p/ef0b4ea299f3</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[aws-s3]]></category>
            <category><![CDATA[aws-ec2]]></category>
            <category><![CDATA[aws-lambda]]></category>
            <category><![CDATA[vishalvnair124]]></category>
            <dc:creator><![CDATA[VISHAL V NAIR]]></dc:creator>
            <pubDate>Fri, 09 May 2025 06:17:16 GMT</pubDate>
            <atom:updated>2025-05-09T06:17:16.576Z</atom:updated>
            <content:encoded><![CDATA[<h3>STEP 1: Upload .py File to S3 Bucket</h3><h4>A. Using AWS Management Console</h4><ol><li>Go to the <a href="https://s3.console.aws.amazon.com/s3/">AWS S3 Console</a>.</li><li>Choose your bucket or create a new one.</li><li>Click <strong>“Upload”</strong> &gt; <strong>Add files</strong> &gt; select your .py file.</li><li>Click <strong>Upload</strong>.</li></ol><h4>B. Using AWS CLI</h4><pre>aws s3 cp your_script.py s3://your-bucket-name/path/to/your_script.py</pre><h3>STEP 2: Access .py File from EC2 Instance</h3><h4>A. Connect to EC2</h4><pre>ssh -i your-key.pem ec2-user@your-ec2-public-ip</pre><h4>B. Install AWS CLI on EC2 (if not installe</h4><pre>sudo yum install aws-cli -y        # for Amazon Linux<br># OR<br>sudo apt install awscli -y         # for Ubuntu</pre><h4>C. Configure AWS CLI (if needed)</h4><pre>aws configure</pre><p>Provide:</p><ul><li>AWS Access Key</li><li>AWS Secret Key</li><li>Region</li><li>Output format (optional)</li></ul><h4>D. Download the File from S3</h4><pre>aws s3 cp s3://your-bucket-name/path/to/your_script.py .</pre><h3>STEP 3: Run the Python Script</h3><pre>python3 your_script.py</pre><blockquote><em>Make sure the script is executable or use </em><em>chmod +x your_script.py if needed.</em></blockquote><p>Would you like help automating this with a script or using IAM roles for secure access?</p><p>4o</p><p>You said:</p><p>B. Using AWS CLI</p><p>how</p><p>ChatGPT said:</p><p>To <strong>upload a </strong><strong>.py file to an S3 bucket using AWS CLI</strong>, follow these <strong>detailed steps</strong>:</p><h3>✅ Prerequisites</h3><ol><li><strong>AWS CLI installed</strong><br> Check with:</li></ol><ul><li>aws --version</li></ul><ol><li>If not installed:</li></ol><ul><li>sudo apt update &amp;&amp; sudo apt install awscli -y</li><li>On Amazon Linux:</li><li>sudo yum install aws-cli -y</li></ul><ol><li><strong>Configured AWS credentials</strong><br> If you haven’t already:</li></ol><ul><li>aws configure</li></ul><ol><li>You will be prompted to enter:</li></ol><ul><li>Access Key ID</li><li>Secret Access Key</li><li>Default Region (e.g., us-east-1)</li><li>Output format (e.g., json)</li></ul><h3>🚀 Upload .py File to S3</h3><p>Use this command format:</p><pre>aws s3 cp your_script.py s3://your-bucket-name/your-folder/</pre><h4>Example:</h4><pre>aws s3 cp hello.py s3://my-python-scripts-folder/</pre><p>If the file uploads successfully, you’ll see:</p><pre>upload: ./hello.py to s3://my-python-scripts-folder/hello.py</pre><h3>🔐 Optional: Use IAM Role (on EC2)</h3><p>If you’re uploading from <strong>an EC2 instance</strong>, it’s better to attach an <strong>IAM role</strong> with AmazonS3FullAccess or limited permissions instead of using aws configure.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ef0b4ea299f3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Method 1: Running a Python Script Manually on an EC2 Instance]]></title>
            <link>https://medium.com/@vishalvnair124/method-1-running-a-python-script-manually-on-an-ec2-instance-108d47e57c5e?source=rss-54c0fd147dd1------2</link>
            <guid isPermaLink="false">https://medium.com/p/108d47e57c5e</guid>
            <category><![CDATA[aws-certification]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[VISHAL V NAIR]]></dc:creator>
            <pubDate>Tue, 29 Apr 2025 14:27:17 GMT</pubDate>
            <atom:updated>2025-04-29T14:27:17.162Z</atom:updated>
            <content:encoded><![CDATA[<h3>Aim:</h3><p>To manually execute a Python script on an Amazon EC2 instance, demonstrating basic instance setup and remote code execution.</p><h3>Requirements:</h3><ul><li>AWS Account</li><li>Key Pair file (.pem)</li><li>AWS Management Console</li><li>Terminal or PuTTY for SSH</li><li>A simple Python script</li><li>Internet connection</li></ul><h3>Procedure:</h3><p><strong>Log in to AWS Console:</strong></p><ul><li>Visit <a href="https://aws.amazon.com/">https://aws.amazon.com</a> and sign in.</li><li>Navigate to <strong>EC2</strong> from the “Services” menu.</li></ul><p><strong>Launch a New EC2 Instance:</strong></p><ul><li>Click <strong>Launch Instance</strong>.</li><li>Choose a basic AMI like <em>Amazon Linux 2</em> or <em>Ubuntu Server</em>.</li><li>Select the <strong>t2.micro</strong> instance type for free tier eligibility.</li><li>Proceed with default configuration options for network and storage.</li><li>In <strong>Security Groups</strong>, allow <strong>SSH (port 22)</strong>.</li><li>Launch the instance using an existing or new key pair (.pem file).</li></ul><p><strong>Connect to the EC2 Instance:</strong></p><p>Go to the EC2 Dashboard and copy the <strong>Public IPv4 address</strong>.</p><ul><li>Open terminal and connect using:</li><li>ssh -i /path/to/your-key.pem ec2-user@your-ec2-ip</li></ul><p><strong>Install Python (if not pre-installed):</strong></p><p><strong>On Amazon Linux:</strong></p><ul><li>sudo yum install python3</li></ul><p><strong>On Ubuntu:</strong></p><ul><li>sudo apt-get install python3</li></ul><p><strong>Upload Your Python Script to EC2:</strong></p><ul><li>From your local machine, use the SCP command:</li><li>scp -i /path/to/key.pem your-script.py ec2-user@your-ec2-ip:/home/ec2-user/</li></ul><p><strong>Run the Python Script:</strong></p><ul><li>Inside EC2, execute:</li><li>python3 your-script.py</li></ul><h3>Conclusion:</h3><p>This experiment successfully demonstrates how to configure an EC2 instance, upload a Python script, and run it remotely. It provides control over cloud resources and is suitable for manual deployment or testing.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=108d47e57c5e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Method 2: Running a Python Script Using AWS Lambda]]></title>
            <link>https://medium.com/@vishalvnair124/method-2-running-a-python-script-using-aws-lambda-550f85d19018?source=rss-54c0fd147dd1------2</link>
            <guid isPermaLink="false">https://medium.com/p/550f85d19018</guid>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[VISHAL V NAIR]]></dc:creator>
            <pubDate>Tue, 29 Apr 2025 14:27:02 GMT</pubDate>
            <atom:updated>2025-04-29T14:27:02.751Z</atom:updated>
            <content:encoded><![CDATA[<h3>Aim:</h3><p>To run a Python script using AWS Lambda for a serverless and auto-scalable deployment approach.</p><h3>Requirements:</h3><ul><li>AWS Account</li><li>AWS Lambda access</li><li>Basic knowledge of Python</li><li>Optional: IAM Role with Lambda execution permissions</li></ul><h3>Procedure:</h3><p><strong>Open AWS Lambda Console:</strong></p><ul><li>From the AWS Console, go to <strong>Lambda</strong> under Services.</li></ul><p><strong>Create a New Lambda Function:</strong></p><ul><li>Click <strong>Create Function</strong>.</li></ul><p>Choose <strong>Author from scratch</strong>.</p><ul><li>Name the function and select <strong>Python 3.x</strong> runtime.</li><li>Create or choose an existing <strong>IAM role</strong> with basic Lambda execution permissions.</li></ul><p><strong>Write or Upload Python Code:</strong></p><ul><li>Use the inline code editor or upload a ZIP file containing your script.</li></ul><p>Example inline code:</p><ul><li>def lambda_handler(event, context): return &quot;Hello from Lambda!&quot;</li></ul><p><strong>Test Your Lambda Function:</strong></p><ul><li>Click <strong>Test</strong>, create a dummy event, and run the function to verify output.</li></ul><p><strong>(Optional) Integrate with EC2 or API Gateway:</strong></p><ul><li>Use <strong>Boto3</strong> to trigger EC2-related actions.</li><li>Or use <strong>API Gateway</strong> to invoke Lambda from a web request.</li></ul><h3>Conclusion:</h3><p>This experiment illustrates how to use AWS Lambda to run Python code without provisioning servers. It’s efficient for tasks that are event-driven or require horizontal scaling.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=550f85d19018" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Method 3 : Running a Python Script Stored in S3 on EC2]]></title>
            <link>https://medium.com/@vishalvnair124/method-3-running-a-python-script-stored-in-s3-on-ec2-fa97c65ad9ff?source=rss-54c0fd147dd1------2</link>
            <guid isPermaLink="false">https://medium.com/p/fa97c65ad9ff</guid>
            <category><![CDATA[aws-certification]]></category>
            <dc:creator><![CDATA[VISHAL V NAIR]]></dc:creator>
            <pubDate>Tue, 29 Apr 2025 14:26:17 GMT</pubDate>
            <atom:updated>2025-04-29T14:26:17.163Z</atom:updated>
            <content:encoded><![CDATA[<h3>Method 3 : Running a Python Script Stored in S3 on EC2</h3><h3>Aim:</h3><p>To download and run a Python script from an S3 bucket on an EC2 instance, combining storage and compute services.</p><h3>Requirements:</h3><ul><li>AWS Account</li><li>AWS S3 bucket with a .py file</li><li>EC2 instance with access to the internet</li><li>AWS CLI installed on EC2</li><li>IAM Role with S3 read permission (or configure credentials manually)</li></ul><h3>Procedure:</h3><p><strong>Connect to Your EC2 Instance via SSH:</strong></p><p>Use:</p><ul><li>ssh -i /path/to/key.pem ec2-user@your-ec2-ip</li></ul><p><strong>Install AWS CLI (if not already installed):</strong></p><ul><li>On Amazon Linux:</li><li>sudo yum install aws-cli</li><li>On Ubuntu:</li><li>sudo apt-get install awscli</li></ul><p><strong>Download Script from S3:</strong></p><ul><li>aws s3 cp s3://your-bucket-name/hello_aws.py /home/ec2-user/</li></ul><p><strong>Run the Script:</strong></p><ul><li>python3 /home/ec2-user/hello_aws.py</li></ul><h3>Conclusion:</h3><p>In this experiment, we retrieved a Python file from an S3 bucket and executed it on EC2, showcasing integration between AWS compute and storage services.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fa97c65ad9ff" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Manual VPC Setup with Public and Private Subnets]]></title>
            <link>https://medium.com/@vishalvnair124/manual-vpc-setup-with-public-and-private-subnets-840d10436d27?source=rss-54c0fd147dd1------2</link>
            <guid isPermaLink="false">https://medium.com/p/840d10436d27</guid>
            <category><![CDATA[vpc]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[VISHAL V NAIR]]></dc:creator>
            <pubDate>Sun, 27 Apr 2025 18:04:30 GMT</pubDate>
            <atom:updated>2025-04-27T18:04:30.398Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Aim:</strong><br> To create a custom Virtual Private Cloud (VPC) with public and private subnets, configure route tables, attach an Internet Gateway and NAT Gateway, and launch public and private EC2 instances.</p><p><strong>Steps:</strong></p><p><strong>Create a VPC:</strong></p><ul><li>Name: <strong>myVpc</strong></li><li>IPv4 CIDR block: (Example: 10.0.0.0/16)</li></ul><p><strong>Create Subnets:</strong></p><ul><li><strong>subNetOne</strong> → Public Subnet (Example: 10.0.1.0/24)</li><li><strong>subNetTwo</strong> → Private Subnet (Example: 10.0.2.0/24)</li></ul><p><strong>Create Route Tables:</strong></p><ul><li><strong>Public Route Table:</strong></li><li>Associate it with <strong>subNetOne</strong> (Public Subnet).</li><li>Edit routes: Add 0.0.0.0/0 to the Internet Gateway.</li><li><strong>Private Route Table:</strong></li><li>Associate it with <strong>subNetTwo</strong> (Private Subnet).</li><li>Edit routes: Add 0.0.0.0/0 to the NAT Gateway.</li></ul><p><strong>Create and Attach Internet Gateway (IGW):</strong></p><ul><li>Create a new Internet Gateway.</li><li>Attach it to <strong>myVpc</strong>.</li><li>Update Public Route Table to route internet traffic via Internet Gateway.</li></ul><p><strong>Create and Attach NAT Gateway (for private subnet internet access):</strong></p><ul><li>Allocate an Elastic IP (EIP).</li><li>Create a NAT Gateway in <strong>subNetOne</strong> (public subnet)</li><li>Update Private Route Table to route internet traffic via the NAT Gateway.</li></ul><p><strong>Launch Instances:</strong></p><ul><li><strong>Public EC2 Instance:</strong></li><li>Launch in <strong>subNetOne</strong> (Public Subnet).</li><li>Associate Public IP.</li><li>Access directly via SSH.</li><li><strong>Private EC2 Instance:</strong></li><li>Launch in <strong>subNetTwo</strong> (Private Subnet).</li><li>No Public IP assigned.</li><li>Connect via Bastion Host (Public EC2) or access external internet using NAT Gateway.</li></ul><p><strong>Conclusion:</strong><br> Successfully created a custom VPC (myVpc) with one public subnet (subNetOne) and one private subnet (subNetTwo). Configured Internet Gateway and NAT Gateway to allow internet access for public and private instances respectively.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=840d10436d27" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating First EC2 Linux Instance]]></title>
            <link>https://medium.com/@vishalvnair124/creating-first-ec2-linux-instance-b48e89e7a2d8?source=rss-54c0fd147dd1------2</link>
            <guid isPermaLink="false">https://medium.com/p/b48e89e7a2d8</guid>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[VISHAL V NAIR]]></dc:creator>
            <pubDate>Sun, 27 Apr 2025 16:48:37 GMT</pubDate>
            <atom:updated>2025-04-27T16:48:37.649Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Aim:</strong><br> To create and launch a Linux-based EC2 instance from the AWS Management Console.</p><p><strong>Steps:</strong></p><p>Login to your AWS account using the AWS Management Console.</p><p>Click on <strong>Services</strong> from the top menu.</p><p>From the dropdown, select <strong>EC2</strong> under “Compute” services.</p><p>Click on <strong>Launch Instance</strong>.</p><p>Choose an Amazon Machine Image (AMI) — select <strong>Amazon Linux 2 AMI (Free Tier eligible)</strong>.</p><p>Select an <strong>Instance Type</strong> — choose <strong>t2.micro</strong> (Free Tier eligible).</p><p>Configure instance details:</p><p>Select the default VPC.</p><p>Select a subnet (or leave default).</p><p>Add Storage — keep default or adjust as needed.</p><p>Add Tags (optional) — for easier identification of the instance.</p><p>Configure Security Group:</p><p>Create a new security group.</p><p>Allow SSH (port 22) to access the Linux server.</p><p>Review all settings and click <strong>Launch</strong>.</p><p>Create a new key pair (.pem file), download it, and click <strong>Launch Instances</strong>.</p><p>Once launched, view the instance from the EC2 Dashboard and note the Public IP for SSH connection.</p><p><strong>Conclusion:</strong><br> Successfully created and launched a Linux-based EC2 instance by logging into the AWS console, navigating to services, and selecting EC2.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b48e89e7a2d8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Amazon Free Tier Account Creation]]></title>
            <link>https://medium.com/@vishalvnair124/amazon-free-tier-account-creation-ab61b1304507?source=rss-54c0fd147dd1------2</link>
            <guid isPermaLink="false">https://medium.com/p/ab61b1304507</guid>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[VISHAL V NAIR]]></dc:creator>
            <pubDate>Sun, 27 Apr 2025 16:43:58 GMT</pubDate>
            <atom:updated>2025-04-27T16:43:58.419Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Aim:</strong><br> To create a free AWS account to access cloud services like EC2, S3, RDS, etc., under the AWS Free Tier.</p><p><strong>Steps:</strong></p><p>Visit the AWS official website (<a href="https://aws.amazon.com/free/">https://aws.amazon.com/free/</a>).</p><p>Click on <strong>Create a Free Account</strong>.</p><p>Enter your email address, password, and AWS account name.</p><p>Provide contact information and select the account type (Personal or Business).</p><p>Enter credit/debit card details for verification (minimal charge may apply).</p><p>Verify your phone number using OTP.</p><p>Choose the basic support plan (Free).</p><p>Complete the signup process and access the AWS Management Console.</p><p><strong>Conclusion:</strong><br> Successfully created an AWS Free Tier account to explore and use various AWS cloud services with limited free resources.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ab61b1304507" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Experiment: Deploy a Container Cluster Using Kubernetes]]></title>
            <link>https://medium.com/@vishalvnair124/experiment-deploy-a-container-cluster-using-kubernetes-ebe13fb24d06?source=rss-54c0fd147dd1------2</link>
            <guid isPermaLink="false">https://medium.com/p/ebe13fb24d06</guid>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[VISHAL V NAIR]]></dc:creator>
            <pubDate>Sat, 12 Apr 2025 13:36:54 GMT</pubDate>
            <atom:updated>2025-04-12T13:36:54.555Z</atom:updated>
            <content:encoded><![CDATA[<h3>Aim:</h3><p>To deploy a containerized application in a Kubernetes cluster using required configurations and commands.</p><h3>Requirements:</h3><ul><li>Docker installed</li><li>Kubernetes cluster (using Minikube or any cloud provider)</li><li>kubectl installed</li></ul><h3>Procedure:</h3><h4>Step 1: Start Minikube (local Kubernetes cluster)</h4><pre>minikube start</pre><p><em>Starts a local Kubernetes cluster using Minikube.</em></p><h4>Step 2: Create a Deployment YAML file</h4><p>Create deployment.yaml:</p><pre>apiVersion: apps/v1<br>kind: Deployment<br>metadata:<br>  name: hello-deployment<br>spec:<br>  replicas: 2<br>  selector:<br>    matchLabels:<br>      app: hello<br>  template:<br>    metadata:<br>      labels:<br>        app: hello<br>    spec:<br>      containers:<br>      - name: hello-container<br>        image: vishalvnair124/hello-docker:latest<br>        ports:<br>        - containerPort: 5000</pre><p><em>Defines a deployment with 2 pods running a Docker image.</em></p><h4>Step 3: Apply the deployment</h4><pre>kubectl apply -f deployment.yaml</pre><p><em>Creates the deployment using the YAML file.</em></p><h4>Step 4: Verify the deployment</h4><pre>kubectl get deployments<br>kubectl get pods</pre><p><em>Shows current deployments and running pods.</em></p><h4>Step 5: Expose the deployment as a service</h4><pre>kubectl expose deployment hello-deployment --type=NodePort --port=5000</pre><p><em>Creates a service to expose the deployment on a port.</em></p><h4>Step 6: Get the service URL</h4><pre>minikube service hello-deployment --url</pre><p><em>Fetches the external URL to access the application.</em></p><h4>Step 7: Test the service</h4><p>Open the URL from the above command in a browser.<br> You should see your app output, e.g., Hello from Docker!</p><h3>Conclusion:</h3><p>A containerized application was successfully deployed to a Kubernetes cluster using a Deployment and exposed using a Service. This demonstrates basic Kubernetes workflow including cluster setup, deployment, and service exposure.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ebe13fb24d06" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lab Manual: Creating a Docker Container Image for a Simple Node.js Web Application]]></title>
            <link>https://medium.com/@vishalvnair124/lab-manual-creating-a-docker-container-image-for-a-simple-node-js-web-application-30d151dde970?source=rss-54c0fd147dd1------2</link>
            <guid isPermaLink="false">https://medium.com/p/30d151dde970</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[nodejs]]></category>
            <dc:creator><![CDATA[VISHAL V NAIR]]></dc:creator>
            <pubDate>Thu, 03 Apr 2025 04:25:42 GMT</pubDate>
            <atom:updated>2025-04-03T04:25:42.779Z</atom:updated>
            <content:encoded><![CDATA[<h3>Aim:</h3><p>To create a Docker container image for a simple Node.js web application, describe the steps involved in creating a Dockerfile, and build the Docker image.</p><h3>Step 1: Setting Up a Simple Node.js Web Application</h3><p>Create a new directory for the Node.js application:</p><ul><li>mkdir node-docker-app &amp;&amp; cd node-docker-app</li></ul><p>Initialize a new Node.js project:</p><ul><li>npm init -y</li></ul><p>Install the Express framework:</p><ul><li>npm install express</li></ul><p>Create an index.js file:</p><ul><li>create index.js</li></ul><p>Add the following Node.js code:</p><h4><strong>const express = require(‘express’);<br>const app = express();<br>const port = 3000;</strong></h4><h4><strong>app.get(‘/’, (req, res) =&gt; {<br> res.send(‘Hello, Dockerized Node.js World!’);<br>});</strong></h4><h4><strong>app.listen(port, () =&gt; {<br> console.log(`Server running on </strong><a href="http://localhost:${port}`"><strong>http://localhost:${port}`</strong></a><strong>);<br>});</strong></h4><p>Save and exit (CTRL + X, then Y, then Enter).</p><h3>Step 2: Creating a Dockerfile</h3><p>In the same directory, create a file named Dockerfile:</p><ul><li>create a Dockerfile</li></ul><p>Add the following content:</p><ul><li># Use an official Node.js runtime as a parent image</li><li>FROM node:14</li><li># Set the working directory inside the container</li><li>WORKDIR /app</li><li># Copy package.json and package-lock.json files</li><li>COPY package*.json ./</li><li># Install application dependencies</li><li>RUN npm install</li><li># Copy the application files COPY . . # Expose</li><li>port 3000 EXPOSE 3000</li><li># Define the command to run the application</li><li>CMD [&quot;node&quot;, &quot;index.js&quot;]</li></ul><p>Save and exit (CTRL + X, then Y, then Enter).</p><h3>Step 3: Building and Running the Docker Image</h3><p>Build the Docker image:</p><ul><li>docker build -t node-docker-app .</li></ul><p>Run the container:</p><ul><li>docker run -p 3000:3000 --rm node-docker-app</li></ul><p>Open a web browser and navigate to:</p><ul><li><a href="http://localhost:3000/">http://localhost:3000</a></li></ul><p>You should see the output:</p><ul><li>Hello, Dockerized Node.js World!</li></ul><h3>Conclusion:</h3><p>In this lab, we created a simple Node.js web application, wrote a Dockerfile to containerize it, built a Docker image, and successfully ran it inside a Docker container. This demonstrates how to containerize Node.js applications for seamless deployment across different environments.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=30d151dde970" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>