A simple service aimed to search AQI stations by city name via interacting with AQI API service https://aqicn.org/api/
- Why this code appeared
- Set up configuration
- Run on local env
- Run as docker container
- Observe in browser
- Write a simple backed service for the settings page of Garmin Watch widget "Air Quality Index"
- Playing with python and learning docker
- Create your own config file
token.ini
based on exampletoken.ini.template
and set your API token generated on this page http://aqicn.org/data-platform/token/#/
(bash) $ PORT=8080 && python3 app/main.py
or
(fish) > set PORT 8080; and python3 app/main.py
- Install
docker
:
$ brew install docker
Then you may build the image locally or pull it from the Docker Hub
- Build image locally
$ docker build --rm -t jctim/aqi-statreq:latest .
- Pull image from the Docker Hub
$ docker pull jctim/aqi-statreq:latest .
$ docker run \
-v $(pwd)/token.ini:/opt/aqi-app/token.ini \
-v $(pwd)/info.log:/opt/aqi-app/info.log \
--env PORT=5001 -p 8080:5001 \
--name my-aqi-statreq \
jctim/aqi-statreq