Skip to content

globoi/globo-prompt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FastAPI with PostgreSQL

This is a containerized FastAPI project with PostgreSQL using Docker.

🚀 How to run

Prerequisites

  • Docker
  • Docker Compose

Running with Docker Compose

  1. Clone the repository and navigate to the folder:
cd globo-prompt
  1. Run the project:
docker-compose up --build
  1. Access the application:

Useful commands

Stop containers:

docker-compose down

Stop and remove volumes (deletes database data):

docker-compose down -v

View logs:

docker-compose logs -f app

Run only the database:

docker-compose up db

📊 Available endpoints

  • GET / - Home page
  • GET /health - Application health check
  • GET /items/{item_id} - Example endpoint with parameters
  • GET /docs - Swagger documentation
  • GET /redoc - ReDoc documentation

🗄️ Database

  • PostgreSQL 15
  • Port: 5432
  • Database: fastapi_db
  • User: postgres
  • Password: postgres

🔧 Development

For local development without Docker:

  1. Install dependencies:
pip install -r requirements.txt
  1. Configure environment variables:
cp .env.example .env
  1. Run the application:
uvicorn main:app --reload

📁 Project structure

globo-prompt/
├── main.py              # FastAPI application
├── requirements.txt      # Python dependencies
├── Dockerfile           # Container configuration
├── docker-compose.yml   # Service orchestration
├── .dockerignore        # Files ignored in build
└── README.md           # This file

🐛 Troubleshooting

Problem: Database connection error

  • Solution: Wait a few seconds for PostgreSQL to fully initialize

Problem: Port 8000 already in use

  • Solution: Change the port in docker-compose.yml or stop other services

Problem: Docker permission error

  • Solution: Run with sudo or add your user to the docker group

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors