diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..946f530f --- /dev/null +++ b/.dockerignore @@ -0,0 +1,12 @@ +*.md +dist +.git +.vscode +.dockerignore +.gitignore +.env +config +build +node_modules +docker-compose.yaml +Dockerfile \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 26eb3701..49d89079 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -17,7 +17,20 @@ git clone https://github.com/your-username/free-hit.git cd free-hit ``` -4. Open CMD in your current directory and install pnpm packages using command.[If pnpm is not installed, you can install it by clicking on this link to [pnpm](https://pnpm.io/installation)] +4. There are two ways to start your application + +- Using Docker Compose + - Docker must be installed and running before proceeding. + - This is the easiest way to start your application without downloading any dependencies that can alter your local versions. + - Below command builds the docker image and starts the container where our app will be running on `http://localhost:5173/` + +```markdown + docker compose up +``` + +- Normal Installation + + - Open CMD in your current directory and install pnpm packages using command.[If pnpm is not installed, you can install it by clicking on this link to [pnpm](https://pnpm.io/installation)] ```markdown pnpm i @@ -78,7 +91,9 @@ git push ``` 7. Create a new pull request from your forked repository (Click the `New Pull Request` button located at the top of your repo) + ### How to Create a PR + 1. After you push the changes you need to create a pull request and name the issue and mention the issue number, eg: chore: added tool #issuenumber 2. The tags which can be used for url submission are as follows: diff --git a/Dockerfile b/Dockerfile index c344ae9c..54100ab5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,20 @@ -FROM node:18 +#PULLING an ALPINE IMAGE (LESS IN SIZE) +FROM node:18-alpine +#INSTALLING PNPM +RUN npm i -g pnpm + +#CHANGING THE DIRECTORY WORKDIR /app -COPY package*.json ./ +#COPYING THE NECESSARY FILES +COPY package.json pnpm-lock.yaml ./ +#RUNNING `PNPM INSTALL` TO INSTALL THE DEPENDENCIES RUN pnpm install +#COPYING THE FILES TO THE APP DIRECTORY COPY . . -EXPOSE 5173 - -CMD ["pnpm", "start"] +#RUNNING THE APPLICATION INSIDE THE CONTAINER +CMD ["pnpm", "start"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..dfdd1907 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,15 @@ +version: '3.8' +services: + app: + stdin_open: true + build: + context: . + dockerfile: Dockerfile + volumes: + - '.:/app' + - /app/node_modules + ports: + - 5173:5173 + environment: + CHOKIDAR_USEPOLLING: 'true' + diff --git a/vite.config.js b/vite.config.js index f16e041c..3cad77f9 100644 --- a/vite.config.js +++ b/vite.config.js @@ -9,4 +9,12 @@ export default defineConfig({ environment: 'jsdom', setupFiles: './tests/setup.js', }, + server: { + watch: { + usePolling: true, + }, + host: true, + strictPort: true, + port: 5173, + } })