From ad0bf7be210eb061bda6dcd4c3efc341d32192ab Mon Sep 17 00:00:00 2001 From: patela22 <39590072+patela22@users.noreply.github.com> Date: Fri, 5 Dec 2025 11:47:56 -0500 Subject: [PATCH 1/4] docker files --- docker-compose.yaml | 24 ++++++++++++++++++++++++ frontend/DockerFile | 18 ++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 docker-compose.yaml create mode 100644 frontend/DockerFile diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..641f902 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,24 @@ +services: + frontend: + env_file: + - ./frontend/.env + build: + context: ./frontend + dockerfile: Dockerfile + args: + VITE_BACKEND_BASE_URL: ${VITE_BACKEND_BASE_URL} + ports: + - "3000:3000" + command: npm start + develop: + watch: + - action: sync+restart + path: ./frontend + target: /app + networks: + - app-network + container_name: frontend + +networks: + app-network: + driver: bridge \ No newline at end of file diff --git a/frontend/DockerFile b/frontend/DockerFile new file mode 100644 index 0000000..c99ad69 --- /dev/null +++ b/frontend/DockerFile @@ -0,0 +1,18 @@ +FROM node:22 + +WORKDIR /app + +COPY package*.json ./ + +RUN npm install + +COPY . . + +ARG VITE_BACKEND_BASE_URL +ENV VITE_BACKEND_BASE_URL=$VITE_BACKEND_BASE_URL + +RUN npm run build + +EXPOSE 3000 + +CMD ["npm", "start"] \ No newline at end of file From ff98348c93fa4e194ea4959c3f4201e40ef3bb52 Mon Sep 17 00:00:00 2001 From: Ansh P <39590072+patela22@users.noreply.github.com> Date: Fri, 5 Dec 2025 11:53:16 -0500 Subject: [PATCH 2/4] Update docker-compose.yaml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- docker-compose.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 641f902..f3dbc8b 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -4,7 +4,7 @@ services: - ./frontend/.env build: context: ./frontend - dockerfile: Dockerfile + dockerfile: DockerFile args: VITE_BACKEND_BASE_URL: ${VITE_BACKEND_BASE_URL} ports: From 368f709c3571c554975ed214aeb87581687568f4 Mon Sep 17 00:00:00 2001 From: patela22 <39590072+patela22@users.noreply.github.com> Date: Fri, 5 Dec 2025 11:56:16 -0500 Subject: [PATCH 3/4] docker ignore --- docker-compose.yaml | 2 +- frontend/.dockerignore | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 frontend/.dockerignore diff --git a/docker-compose.yaml b/docker-compose.yaml index f3dbc8b..f643fc0 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -9,7 +9,7 @@ services: VITE_BACKEND_BASE_URL: ${VITE_BACKEND_BASE_URL} ports: - "3000:3000" - command: npm start + command: npm run build develop: watch: - action: sync+restart diff --git a/frontend/.dockerignore b/frontend/.dockerignore new file mode 100644 index 0000000..0a5f9af --- /dev/null +++ b/frontend/.dockerignore @@ -0,0 +1,6 @@ +node_modules +.git +.gitignore +.env +dist +*.log \ No newline at end of file From 84cae0d7a62ae0421b029afc295ace079b6701b5 Mon Sep 17 00:00:00 2001 From: patela22 <39590072+patela22@users.noreply.github.com> Date: Fri, 5 Dec 2025 11:56:54 -0500 Subject: [PATCH 4/4] fix --- frontend/DockerFile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/DockerFile b/frontend/DockerFile index c99ad69..5dfd407 100644 --- a/frontend/DockerFile +++ b/frontend/DockerFile @@ -15,4 +15,4 @@ RUN npm run build EXPOSE 3000 -CMD ["npm", "start"] \ No newline at end of file +CMD ["npm", "run", "build"] \ No newline at end of file