Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/faisal-fida/fastapi-docker-project
This project is a simple FastAPI application that demonstrates how to build and deploy a web API using Docker. The application includes a scraper that fetches the IP address from a specified URL.
https://github.com/faisal-fida/fastapi-docker-project
deployment docker docker-compose fastapi
Last synced: about 1 month ago
JSON representation
This project is a simple FastAPI application that demonstrates how to build and deploy a web API using Docker. The application includes a scraper that fetches the IP address from a specified URL.
- Host: GitHub
- URL: https://github.com/faisal-fida/fastapi-docker-project
- Owner: faisal-fida
- Created: 2024-01-24T16:38:43.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-06T07:37:27.000Z (4 months ago)
- Last Synced: 2024-11-10T21:16:22.247Z (3 months ago)
- Topics: deployment, docker, docker-compose, fastapi
- Language: Python
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# FastAPI Docker Project
This project is a simple FastAPI application that demonstrates how to build and deploy a web API using Docker. The application includes a scraper that fetches the IP address from a specified URL.
## Table of Contents
- [Installation](#installation)
- [Usage](#usage)
- [Complexities](#complexities)
- [Solutions](#solutions)
- [Challenges](#challenges)
- [License](#license)## Installation
1. Clone the repository:
```sh
git clone https://github.com/faisal-fida/fastapi_docker_project.git
cd fastapi_docker_project
```2. Install the dependencies:
```sh
pip install -r requirements.txt
```3. Create a `.env` file with the following content:
```
URL=
```4. Run the application:
```sh
uvicorn app:app --reload
```## Usage
The application provides two endpoints:
1. `GET /` - Returns a message indicating the server is running.
2. `GET /ip` - Returns the IP address fetched by the scraper.- **Environment Variables**: The project uses `python-dotenv` to manage environment variables, which allows for secure and flexible configuration.
- **Dependency Management**: Dependencies are managed using a `requirements.txt` file, ensuring that the correct versions of packages are used.
- **External API Dependency**: The scraper relies on an external URL to fetch the IP address. Network issues or changes in the external API could affect the application's functionality.
- **Configuration Management**: Managing environment variables securely and ensuring they are correctly set up can be challenging, especially in different environments (development, staging, production).## License
This project is licensed under the MIT License. See the LICENSE file for details.