This app pulls data from openweathermap.com and adds the data to your mongodb instance.
Visit:
- http://localhost:8081/ to see the database.
-
Register to open weather website and get a key. Free version just fine.
-
Add below environment file, fill your api key there.
# .env file contents MONGODB_HOST=mongodb MONGODB_PORT=27017 MONGODB_USER=root MONGODB_PASSWORD=<your-key-here> OPEN_WEATHER_API_KEY=<your-key-here>
-
Run
docker-compose -f "docker-compose.yml" up -d --build
to build and run the containers. -
That's It!
-
Stop the containers
docker-compose -f 'docker-compose.yml' -p 'docker-weather' stop
after.
Build the image:
docker build --pull --rm -f "Dockerfile" -t dockerweather:latest "."
Run a container with local .env
file.
docker run --rm -it --env-file .env -p 27017:27017 dockerweather:latest