Skip to content

mate-academy/py-docker-weather-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker Weather API

Task

In this task you will be implementing the service for getting current weather for Paris city. But the most interesting part, that this service must be dockerized and pushed to the dockerhub. Use Weather API for getting data about the weather.

The result of this task will be tested by the next commands: img.png Of course, instead of danylott - it must be your docker id.

So in this task requirements are next:

  • The script for getting & printing weather info must be located at app/main.py;

  • This service must be Dockerized using only Dockerfile (docker-compose.yml here is forbidden);

  • The image of the service should be as thin as possible;

  • Use .dockerignore file to avoid adding unnecessary stuff to docker image;

  • You must use requests module for interacting with Weather API;

  • You must publish your image to Docker Hub and check it is available for the world;

  • You need to generate API_KEY for using Weather API, but it shouldn't be hard-coded in main.py.

    You should use environment variables for that purpose. So, read API_KEY from environment. And to pass environment variables to docker container use -e flag.

  • Don't forget to add .dockerignore file to your PR;

  • You must modify this line with correct command to pull your image: COMMAND=docker pull <YOUR_DOCKER_ID/YOUR_IMAGE_NAME>.

Hint Don't use `< >` in docker command. Here is the example:

docker pull test_user/weather

Note: Check your code using this checklist before pushing your solution.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages