From ee0b3e060bdf2dc220d4432a9f7fbd3eca5f0ba6 Mon Sep 17 00:00:00 2001 From: Amit Sah Date: Tue, 31 Oct 2023 16:40:05 +0530 Subject: [PATCH 1/3] updt --- .dockerignore | 2 ++ .gitignore | 2 ++ Dockerfile | 23 +++++++++++++++++++++++ 3 files changed, 27 insertions(+) create mode 100644 .dockerignore create mode 100644 .gitignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..04c01ba --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +node_modules/ +dist/ \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..04c01ba --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +node_modules/ +dist/ \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..4a84c35 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,23 @@ +# Use an official Node.js runtime as the base image +FROM node:14 + +# Set the working directory in the container +WORKDIR /app + +# Copy package.json and package-lock.json to the container +COPY package*.json ./ + +# Install project dependencies +RUN npm install + +# Copy the rest of your application code to the container +COPY . . + +# Build your Vite app (you can change the command if necessary) +RUN npm run build + +# Expose the port your app will run on (adjust as needed) +EXPOSE 8080 + +# Command to start your application +CMD ["npm", "run", "preview"] From 872760f7931f52262258f0a52d05b25e79d78a0c Mon Sep 17 00:00:00 2001 From: Amit Sah Date: Tue, 31 Oct 2023 16:41:50 +0530 Subject: [PATCH 2/3] v2 --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 0108ca6..c0d3e5f 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,12 @@ { "name": "fem-dictionary-web-app", - "version": "1.0.0", + "version": "1.0.1", "description": "Front-end mentor dictionary web app", "main": "index.js", "scripts": { - "start": "vite", + "start": "vite --host 0.0.0.0", "build": "vite build", - "preview": "vite preview --port 8080" + "preview": "vite preview --host 0.0.0.0 --port 8080" }, "repository": { "type": "git", From c4e5cb9fe8a76f8c568a3428bb7be5dd1daf84fd Mon Sep 17 00:00:00 2001 From: Amit Sah Date: Tue, 31 Oct 2023 16:50:56 +0530 Subject: [PATCH 3/3] Update README.md Doc updated --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 8d18876..9568f8a 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,17 @@ It appears that the project you're trying to run uses Vite as its build tool and development server. Here are the steps to run the `fem-dictionary-web-app` project on your localhost: +METHOD 1. **USING DOCKER** + If Docker install in your machine run below command + + ```sh + docker run -p 8080:8080 aksamitsah/fem-dictionary-web-app + ``` + + ```sh + docker run -d -p 8080:8080 aksamitsah/fem-dictionary-web-app # RUN in Background + ``` + 1. **Clone the Repository:** If you haven't already, clone the repository as mentioned earlier: