A simple Flask web app that displays a 7-day weather forecast for any location, powered by WeatherAPI.com. Built as the final project for a DevOps bootcamp — the goal was to take a small Python app from source all the way to a production-style deployment using containers, a reverse proxy, and a systemd-managed service.
- Backend: Python 3.9, Flask
- Templating: Jinja2
- Production server: Gunicorn
- Reverse proxy: Nginx
- Container: Docker (multi-stage build)
- Process manager: systemd (for bare-metal deploy)
- External API: WeatherAPI.com
Add a screenshot of the running app here, e.g.

- A free API key from WeatherAPI.com
- For local dev: Python 3.9+
- For container deploy: Docker
- For systemd deploy: Ubuntu (or any systemd-based Linux), Python 3, pip
| Variable | Required | Description |
|---|---|---|
WEATHER_API_KEY |
Yes | Your API key from WeatherAPI.com |
pip install -r requirements.txt
export WEATHER_API_KEY=your_key_here # PowerShell: $env:WEATHER_API_KEY="your_key_here"
python app.pyVisit http://localhost:5000.
Pull and run the pre-built image:
docker run -dti -p 80:80 -e WEATHER_API_KEY=your_key_here danos23/weatherapp:finalOr build from source:
docker build -t capyweather .
docker run -dti -p 80:80 -e WEATHER_API_KEY=your_key_here capyweather- Copy the project files to your target machine (e.g.,
/home/ubuntu/web-app). - Install Python and pip:
sudo apt install python3 python3-pip
- Install the Python dependencies:
pip3 install -r requirements.txt
- Set the API key (e.g., in
/etc/environmentor a systemdEnvironment=directive). - Install the systemd unit:
sudo cp gunicorn_webapp.service /etc/systemd/system/ sudo systemctl daemon-reload sudo systemctl enable --now gunicorn_webapp - (Optional) Drop
nginx.confinto/etc/nginx/conf.d/and reload Nginx to expose the app on port 80.
web-app/
├── app.py # Flask application
├── templates/
│ ├── layout.html # Base template
│ └── home.html # Forecast view
├── Dockerfile # Multi-stage Python -> Nginx image
├── nginx.conf # Reverse proxy config
├── gunicorn_webapp.service # systemd unit
├── requirements.txt # Python dependencies
└── README.md