This project is a React TypeScript application built with Vite. Below are instructions for running the project within a Docker container.
- Docker installed on your machine
-
Build the Docker Image:
Run the following command in the root directory of the project:
docker build -t my-react-app .
-
Run the Docker image:
docker run -d -p 3000:80 my-react-app
3: Then Open http://localhost:3000/ to have a look.
4: Stopping the container:
Get the docker id first
docker ps
.
docker stop <container_id>
1: you must add a .env file in the root of the app
VITE_NEWS_API_KEY=xxx
VITE_GUARDIAN_API_KEY=xxx
VITE_NYT_API_KEY=xxx
2: npm install or yarn install
3: npm run dev