Skip to content

Commit

Permalink
Merge pull request #57 from Arnob-B/main
Browse files Browse the repository at this point in the history
dockerization
  • Loading branch information
abhrajit2004 authored Oct 27, 2024
2 parents 1c78708 + 09a669f commit af32e3a
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 1 deletion.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,30 @@ Presenting A Twitter Landing Page Clone done using HTML and Tailwind CSS.
npm run dev
```

# Testing Via docker
> make sure you have docker installed

### steps
1. **Clone your forked repository**:

```bash
git clone <your forked repository link>
```
2. **Change directory**:

```bash
cd Twitter-Landing-Page
```
4. **Building the Image**:

```bash
docker build -t my-twitter-app .
```
3. **Run the container**:

```bash
docker run -p 5173:5173 my-twitter-app
```
# How to make a Pull Request
1. **Clone your forked repository**:

Expand Down
20 changes: 20 additions & 0 deletions dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# using latest node alpine base image
FROM node:23-alpine

# setting up the working as app
WORKDIR /app

# layering to avoid unnecesary builds
COPY package.json ./
COPY package-lock.json ./

# setting up registry as in some cases npm i was taking too long
RUN npm config set registry https://registry.npmjs.org/ && \
npm install --legacy-peer-deps --verbose

# copying other files
COPY . .

EXPOSE 5173

CMD ["npm", "run", "dev"]
10 changes: 10 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "npx tailwindcss -i ./css/input.css -o ./css/output.css --watch",
"dev" : "vite"
"dev": "vite --host"
},
"keywords": [],
"author": "",
Expand All @@ -15,6 +15,7 @@
"tailwindcss": "^3.4.1"
},
"dependencies": {
"explain": "^2.1.0",
"vite": "^5.0.12"
}
}

0 comments on commit af32e3a

Please sign in to comment.