From 15f5ee26b2e00bf7f49c98b72f667b21cee84880 Mon Sep 17 00:00:00 2001 From: Satvik-Singh192 Date: Wed, 12 Nov 2025 17:52:48 +0530 Subject: [PATCH] feat: dockerized the whole project, single command run available now --- .dockerignore | 5 +++++ Dockerfile | 8 ++++++++ README.md | 10 ++++++++++ docker-compose.yml | 10 ++++++++++ 4 files changed, 33 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..c3504da --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +node_modules +dist +.git +.gitignore +README.md diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..d923fa6 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,8 @@ +FROM node:22-alpine + +WORKDIR /app +COPY package*.json ./ +RUN npm install +COPY . . +EXPOSE 5173 +CMD ["npm", "run", "dev"] diff --git a/README.md b/README.md index d57c2fa..3071d04 100644 --- a/README.md +++ b/README.md @@ -162,7 +162,17 @@ Step through **state transitions** and **table updates** interactively to unders git clone https://github.com//Algo-Visualizer.git cd Algo-Visualizer ``` +## 🐳 Run with Docker +Make sure **Docker** is installed and running on your system. +You don’t need to install **Node.js** or any dependencies manually — Docker handles everything. + +To start the development server, run: + +```bash +docker compose up +``` +Then open http://localhost:5173 in your browser to view the app. ### 2️⃣ Install Dependencies ```bash npm install diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..21a6758 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,10 @@ +services: + algo-visualizer: + build: . + container_name: algo-visualizer-dev + ports: + - "5173:5173" + volumes: + - .:/app + - /app/node_modules + command: ["npm", "run", "dev", "--", "--host"]