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"] 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: 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",