How To Run Docker Container Locally
NOTE : Make sure you haveDocker installed
- To
Buildandrunthe docker image paste this in one line -
docker build
--build-arg PORT=8080
--build-arg CORS_ORIGIN=http://localhost:3000
--build-arg DB_USERNAME=<username>
--build-arg DB_PASSWORD=<password>
--build-arg BackendHost=http://localhost:8080
--build-arg JWT_SECRET_KEY=<secret>
--build-arg GEMINI_API_KEY=<GEMINI-API-KEY>
--build-arg PingBotDuration=300000
--build-arg MemoryLimitForOutputFileInBytes=31457280
--build-arg REACT_APP_SERVER_URL=http://localhost:8080
--build-arg REACT_APP_SERVER_WS_URL=ws://localhost:8080
-t testimage . ; docker run -p 8080:8080 testimage
- You can then access the web-app from
http://localhost:8080 - This will build and use the static build from react in the
buildinside the container. - For explanation of each build Argument refer Builds Arguments.
To run React Frontend
cd Frontendnpm install- create a
.env - save the
.envwith required parameters - npm start