0% found this document useful (0 votes)
4 views2 pages

Devops

The document outlines a step-by-step guide for dockerizing a simple Node.js application, including creating the app, setting up a Dockerfile, and running the container. It details the necessary commands and file structures for building and executing the application within a Docker environment. Additionally, it includes a rubric for evaluating the project based on various criteria.

Uploaded by

Prakash Sahu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views2 pages

Devops

The document outlines a step-by-step guide for dockerizing a simple Node.js application, including creating the app, setting up a Dockerfile, and running the container. It details the necessary commands and file structures for building and executing the application within a Docker environment. Additionally, it includes a rubric for evaluating the project based on various criteria.

Uploaded by

Prakash Sahu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Coding Phase: Pseudo Code / Flow Chart / Algorithm

Step-by-Step Dockerization Script

1. Create a simple Node.js app

mkdir my-app && cd my-app

echo 'const http = require("http");

const PORT = process.env.PORT || 3000;

const server = http.createServer((req, res) => {

res.end("Hello from Dockerized Node.js App!");

});

server.listen(PORT, () => {

console.log(Server running on port ${PORT});

});' > app.js

echo '{

"name": "my-app",

"version": "1.0.0",

"main": "app.js",

"scripts": { "start": "node app.js" }

}' > package.json

2. Create a Dockerfile

echo 'FROM node:18

WORKDIR /app

COPY . .

RUN npm install

EXPOSE 3000

CMD ["npm", "start"]' > Dockerfile


Testing Phase: Compilation of Code (error detection)

Implementation Phase: Final Output (no error)


1. Create your application code, e.g., a simple app.js for Node.js.

2. Add a package.json to manage dependencies and define a start script.

3. Create a Dockerfile with instructions to set up the container environment.

4. Use FROM to choose a base image, like node:18 for Node.js.

5. COPY source files, install dependencies, and expose necessary ports.

6. Build the Docker image using docker build -t my-app ..

7. Run the container with docker run -p 3000:3000 my-app.

Rubrics
Concept 10
Planning and Execution/ 10
Practical Simulation/ Programming
Result and Interpretation 10
Record of Applied and Action Learning 10
Viva 10
Total 50

Signature of the Student:

Signature of the Faculty:

You might also like