This project demonstrates how to build and deploy a React-based weather application using Docker for containerization and Nginx as a reverse proxy server.
- Docker installed on your machine (Docker Installation Guide)
Follow these steps to get the project up and running on your local machine:
-
Clone the repository:
git clone <repository-url> cd <repository-directory>
-
Create a .env file in the root directory (if required for API keys or configurations):
REACT_APP_WEATHER_API_KEY=YOUR_API_KEY
Replace YOUR_API_KEY with your OpenWeatherMap API key.
-
Build and run the Docker container:
docker build -t weather-app . && docker run -p 8080:80 weather-app
-
View the application: Open your web browser and go to http://localhost:8080 to see the weather application.
- nginx: Contains Nginx configuration files.\
- nginx.conf: Nginx configuration for serving the React app.\
- src: Contains the source code for the React application.\
- App.js: Main React component fetching and displaying weather data.
- Environment Variables: Modify .env file to update API keys or configuration variables.\
- Nginx Configuration: Adjust nginx/nginx.conf if custom server configurations are needed.
This project is licensed under the MIT License - see the LICENSE file for details.
- Built using create-react-app
- Docker and Nginx configurations inspired by best practices and community examples.
If encountering issues, ensure Docker is running and ports are correctly mapped (-p 8080:80).