diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..b512c09 --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +node_modules \ No newline at end of file diff --git a/README.md b/README.md index 0a999b6..32c9d36 100644 --- a/README.md +++ b/README.md @@ -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 + ``` +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**: diff --git a/dockerfile b/dockerfile new file mode 100644 index 0000000..79695c8 --- /dev/null +++ b/dockerfile @@ -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"] \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 0126039..6ad3b76 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,7 @@ "version": "1.0.0", "license": "ISC", "dependencies": { + "explain": "^2.1.0", "vite": "^5.0.12" }, "devDependencies": { @@ -890,6 +891,15 @@ "@esbuild/win32-x64": "0.19.12" } }, + "node_modules/explain": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/explain/-/explain-2.1.0.tgz", + "integrity": "sha512-jcLCM7YYitf+OxsoDem1UTqpn8nwqwHbhVof+EcKdXqxTdMfBlbBttXGFIfk8Mg+FJ9M5YNyh8NNlJalahPyCg==", + "engines": "v0.8.14", + "bin": { + "explain": "bin/explain" + } + }, "node_modules/fast-glob": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", diff --git a/package.json b/package.json index edd883a..6dde6e1 100644 --- a/package.json +++ b/package.json @@ -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": "", @@ -15,6 +15,7 @@ "tailwindcss": "^3.4.1" }, "dependencies": { + "explain": "^2.1.0", "vite": "^5.0.12" } }