A simple Python Flask application that fetches real-time weather information using the OpenWeather API. This project is built for learning Python, Docker containerization, and GitHub workflows.
- Real-time weather lookup
- Flask + HTML template front-end
- Dockerized application
- API key support using environment variables
- Ready for CI/CD using GitHub Actions
weather-python/
│── app.py
│── requirements.txt
│── Dockerfile
│── templates/
│ └── index.html
│── README.md
python -m venv venv
.\venv\Scripts\activate # Windowspip install -r requirements.txt$env:WEATHER_API_KEY="your_api_key_here"python app.pyApp runs at:
docker build -t username/weather-app:latest .docker run -p 5000:5000 -e WEATHER_API_KEY=your_api_key username/weather-app:latestApp available at:
git initgit add .
git commit -m "Initial commit"git branch -M maingit remote add origin <your-repo-url>git push -u origin maingit pull origin main --allow-unrelated-histories
git push origin main| Variable | Description |
|---|---|
WEATHER_API_KEY |
Your OpenWeather map API key |
FROM python:3.10-slim
ARG WEATHER_API_KEY
ENV WEATHER_API_KEY=$WEATHER_API_KEY
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
EXPOSE 5000
CMD ["python", "app.py"]Feel free to fork the repo and submit pull requests.
For any issues, open a GitHub issue in this repository.