From a2482bb419f5ed7a528b5715953fcc584a82f947 Mon Sep 17 00:00:00 2001 From: this-Aditya Date: Tue, 3 Sep 2024 15:51:14 +0530 Subject: [PATCH 1/3] Added Dockerfile and docker-compose for live reload during development --- Dockerfile.dev | 13 +++++++++++++ docker-compose.live-reload.yml | 12 ++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 Dockerfile.dev create mode 100644 docker-compose.live-reload.yml diff --git a/Dockerfile.dev b/Dockerfile.dev new file mode 100644 index 0000000..aac24dd --- /dev/null +++ b/Dockerfile.dev @@ -0,0 +1,13 @@ +FROM node:20.9.0-alpine + +RUN mkdir -p /app + +WORKDIR /app + +COPY package*.json ./ + +RUN npm install + +EXPOSE 3000 + +CMD ["npm", "run", "dev"] diff --git a/docker-compose.live-reload.yml b/docker-compose.live-reload.yml new file mode 100644 index 0000000..0f567d7 --- /dev/null +++ b/docker-compose.live-reload.yml @@ -0,0 +1,12 @@ +version: '3.7' +services: + sep-ui-live-dev: + build: + context: . + dockerfile: ./Dockerfile.dev + ports: + - '3000:3000' + volumes: + - .:/app + environment: + - PORT=3000 From d72af9a5269c92f1e0cab240cb6ca06707f9cbfa Mon Sep 17 00:00:00 2001 From: Aditya Mishra <98681758+this-Aditya@users.noreply.github.com> Date: Tue, 3 Sep 2024 17:03:49 +0530 Subject: [PATCH 2/3] Modifying command Co-authored-by: Yatharth Ranjan --- Dockerfile.dev | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile.dev b/Dockerfile.dev index aac24dd..77334de 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -10,4 +10,4 @@ RUN npm install EXPOSE 3000 -CMD ["npm", "run", "dev"] +CMD ["npm", "run", "dev", "--", "-p", "3000"] From 543c236641d0a9be62c205f9e4e44c761b681643 Mon Sep 17 00:00:00 2001 From: this-Aditya Date: Tue, 3 Sep 2024 17:05:12 +0530 Subject: [PATCH 3/3] Moved setting environment vars to dockerfile and add new volume --- Dockerfile.dev | 2 ++ docker-compose.live-reload.yml | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile.dev b/Dockerfile.dev index 77334de..27c6f63 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -8,6 +8,8 @@ COPY package*.json ./ RUN npm install +ENV PORT=3000 + EXPOSE 3000 CMD ["npm", "run", "dev", "--", "-p", "3000"] diff --git a/docker-compose.live-reload.yml b/docker-compose.live-reload.yml index 0f567d7..ad57436 100644 --- a/docker-compose.live-reload.yml +++ b/docker-compose.live-reload.yml @@ -8,5 +8,4 @@ services: - '3000:3000' volumes: - .:/app - environment: - - PORT=3000 + - /app/node_modules