https://github.com/davidrr-f/pokemon_api
Pokemon API and Database w/ Postgres Vector DB Extension
https://github.com/davidrr-f/pokemon_api
docker fast-api nginx pgvector postgresql
Last synced: 12 months ago
JSON representation
Pokemon API and Database w/ Postgres Vector DB Extension
- Host: GitHub
- URL: https://github.com/davidrr-f/pokemon_api
- Owner: DavidRR-F
- Created: 2023-04-15T19:42:26.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-04-23T12:34:53.000Z (almost 3 years ago)
- Last Synced: 2025-01-05T05:42:02.450Z (about 1 year ago)
- Topics: docker, fast-api, nginx, pgvector, postgresql
- Language: Python
- Homepage:
- Size: 7.95 MB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Pokemon API
This is a project that uses two Docker containers and an Nginx server to host them. The first container is a PostgreSQL database that stores the data, while the second container is a FastAPI API that provides an interface for accessing and manipulating the data stored in the database. Each container has its own Dockerfile that defines its build and runtime configuration. A Docker Compose file is used to define the environment for the project, including the containers and their configurations, as well as the Nginx server that acts as a reverse proxy. The Nginx server forwards incoming requests to the appropriate container, while the Docker Compose file includes the necessary configuration for setting up the connections between the containers and the Nginx server. By running the Docker Compose file, you can launch the entire project, including the database, API, and Nginx server, all in a single environment. This setup makes it easy to deploy, manage, and scale the project by adding more containers or adjusting their configurations.
## Run Containerized Project
```
$ docker-compose up -d
```
## Run Project Locally
- Run the Database
```
$ cd database
$ docker build -t pokebase .
$ docker run -p 5433:5432
```
- In the api/database.py update the database connection url as follows

- Run the API
```
$ pip install -r requirements.txt
$ uvicorn api.main:app --reload
```