diff --git a/docker-compose.yml b/docker-compose.yml index 67f5b1a..4b0b9ac 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -22,6 +22,8 @@ services: dockerfile: Dockerfile.dev ports: - "3000:3000" + environment: + - REACT_APP_PORT=80 networks: - fondant-network volumes: diff --git a/frontend/Dockerfile b/frontend/Dockerfile index a933bca..99636e7 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -6,5 +6,7 @@ COPY . ./ RUN npm run build RUN npm install -g serve COPY . ./ +ARG REACT_APP_PORT +ENV REACT_APP_PORT=${REACT_APP_PORT} EXPOSE 3000 CMD ["serve", "-s", "build", "-l", "3000"] diff --git a/frontend/src/constant.ts b/frontend/src/constant.ts index b639319..ef5d379 100644 --- a/frontend/src/constant.ts +++ b/frontend/src/constant.ts @@ -1,4 +1,4 @@ export const NUM_OF_NODES_CONSIDERED_RUNNING = 5 export const DEFAULT_NODE_NUMBER = 1 -export const NODE_URL = "http://localhost" +export const NODE_URL = `http://localhost:${process.env.REACT_APP_PORT}` export const NODE_URL_PORT = "http://localhost:3001"