Skip to content

Commit b782bd0

Browse files
Merge pull request #2 from NEELOFARKHAN22/master
Add Dockerfile and README.md
2 parents 6ddb6b8 + 4922991 commit b782bd0

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,14 @@ npm install
55

66
to run
77
node index.js
8+
# Node.js Web Application
9+
10+
This is a Node.js web application.
11+
12+
## Build and Run with Docker
13+
14+
1. Clone the repository:
15+
```bash
16+
git clone https://github.com/NEELOFARKHAN22/nodejsApp.git
17+
cd nodejsApp
18+

dockerfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Use an official Node.js base image
2+
FROM node:14
3+
4+
# Set the working directory to /app
5+
WORKDIR /app
6+
7+
# Copy the application code into the container
8+
COPY . /app
9+
10+
# Install dependencies
11+
RUN npm install
12+
13+
# Expose port 3000
14+
EXPOSE 3000
15+
16+
# Use a non-root user to run the application
17+
USER node
18+
19+
# Command to start the application
20+
CMD ["npm", "start"]
21+

nodejsApp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit 69e84ddd94151bae2c51e2f88c1275517e591ee6

0 commit comments

Comments
 (0)