From 33881b458a442d4a348731b41214f41ab19f76c5 Mon Sep 17 00:00:00 2001 From: Semyon Katz Date: Sat, 27 Jan 2024 01:56:57 +0200 Subject: [PATCH 1/3] fix: :bug: fix path for image in shopping-item --- src/components/product-card/index.tsx | 2 +- src/components/shopping-item/index.tsx | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/product-card/index.tsx b/src/components/product-card/index.tsx index b05e846..f9c1061 100644 --- a/src/components/product-card/index.tsx +++ b/src/components/product-card/index.tsx @@ -87,7 +87,7 @@ const ProductCard: React.FC = ({ = (props) => { {product.name} From 6d596de53f710ad3437effcb16a354b771b92c64 Mon Sep 17 00:00:00 2001 From: Semyon Katz Date: Sat, 27 Jan 2024 15:24:42 +0200 Subject: [PATCH 2/3] fix: :bug: add env vars config for vite --- env.d.ts | 1 + vite.config.ts | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/env.d.ts b/env.d.ts index 3fafe64..9d41ba2 100644 --- a/env.d.ts +++ b/env.d.ts @@ -1,5 +1,6 @@ interface ImportMetaEnv { VITE_API_URL: string; + VITE_BASE_URL: string; NODE_ENV: string; VITE_JWT_SECRET: string; VITE_PORT: string; diff --git a/vite.config.ts b/vite.config.ts index d130a73..373fc88 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -21,4 +21,8 @@ export default defineConfig({ }, }, plugins: [react(), svgr()], + define: { + VITE_BASE_URL: process.env.VITE_BASE_URL, + VITE_API_URL: process.env.VITE_API_URL, + }, }); From 48d4c468c0be40f710326dd5cf0af89d8cdd4f72 Mon Sep 17 00:00:00 2001 From: Semyon Katz Date: Sat, 27 Jan 2024 23:46:30 +0200 Subject: [PATCH 3/3] fix: :bug: add env injection commands to dokerfile --- Dockerfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Dockerfile b/Dockerfile index 398ff5e..a30ceae 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,5 +3,9 @@ WORKDIR /app COPY package*.json . RUN npm install COPY . . +ARG VITE_BASE_URL +ENV VITE_BASE_URL=$VITE_BASE_URL +ARG VITE_API_URL +ENV VITE_API_URL=$VITE_API_URL RUN npm run build CMD cp -r build result_build