UPD using a dotenv file as base

This commit is contained in:
Shaun Orssaud 2023-10-31 13:47:40 +09:00
parent 665cf937e0
commit dd27a9d142
6 changed files with 9 additions and 4 deletions

View File

@ -2,7 +2,7 @@
FROM node:18 as build-step
WORKDIR /frontend
ENV PATH /frontend/node_modules/.bin:$PATH
COPY frontend/package.json frontend/yarn.lock frontend/tsconfig.json ./
COPY frontend/package.json frontend/yarn.lock frontend/tsconfig.json frontend/.env ./
COPY frontend/src ./src
COPY frontend/public ./public
RUN yarn install

View File

@ -12,5 +12,3 @@ services:
image: codex-frontend-client
ports:
- "3000:80"
environment:
- CODEX_URL=http://loiujhaiuhailuhost:8080

1
frontend/.env Normal file
View File

@ -0,0 +1 @@
REACT_APP_CODEX_URL=http://localhost:8080

View File

@ -18,6 +18,7 @@
"@types/react": "^18.2.25",
"@types/react-dom": "^18.2.11",
"axios": "^1.5.1",
"dotenv": "^16.3.1",
"form-data": "^4.0.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",

View File

@ -28,7 +28,7 @@ export const useDexyStore = create<DexyState>()(
ftdCid: "",
setFtdCid: (cid) => set({ ftdCid: cid }),
nodeInfo: {
baseUrl: process.env.CODEX_URL || "http://localhost:8080",
baseUrl: process.env.REACT_APP_CODEX_URL || "http://localhost:8080",
nodeToConnectTo: null,
id: null,
// ip: null,

View File

@ -4304,6 +4304,11 @@ dotenv@^10.0.0:
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-10.0.0.tgz#3d4227b8fb95f81096cdd2b66653fb2c7085ba81"
integrity sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q==
dotenv@^16.3.1:
version "16.3.1"
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.3.1.tgz#369034de7d7e5b120972693352a3bf112172cc3e"
integrity sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==
duplexer@^0.1.2:
version "0.1.2"
resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.2.tgz#3abe43aef3835f8ae077d136ddce0f276b0400e6"