Lots of changes to support Alembic and external DB

This commit is contained in:
James Pattinson
2025-12-04 17:54:49 +00:00
parent d33ad725cb
commit b6ad496cf0
14 changed files with 919 additions and 160 deletions

View File

@@ -28,12 +28,60 @@ A modern, containerized Prior Permission Required (PPR) system for aircraft oper
### Prerequisites
- Docker and Docker Compose installed
### 1. Start the System
### Development Setup
**Start the system (automatic database setup):**
```bash
cd nextgen
./start.sh
docker compose up -d
```
That's it! The container automatically:
- Waits for database to be ready
- Creates schema via Alembic migrations
- Loads airport and aircraft reference data
- Starts the API with auto-reload
**View startup logs:**
```bash
docker compose logs -f api
```
### Production Deployment
**Simple automated deployment:**
```bash
# 1. Configure environment
cp .env.example .env
nano .env # Set your external database credentials
# 2. Start with production settings
docker compose -f docker-compose.prod.yml up -d
```
The container automatically handles:
- Database connection verification
- Schema creation/migration (Alembic)
- Reference data seeding (if needed)
- Production server startup (4 workers)
**Monitor deployment:**
```bash
docker compose -f docker-compose.prod.yml logs -f api
```
**Deploying updates with migrations:**
```bash
git pull
docker compose -f docker-compose.prod.yml up -d --build
# Migrations apply automatically!
```
**See detailed guides:**
- [`AUTOMATED_MIGRATION_GUIDE.md`](./AUTOMATED_MIGRATION_GUIDE.md) - How automatic migrations work
- [`PRODUCTION_MIGRATION_GUIDE.md`](./PRODUCTION_MIGRATION_GUIDE.md) - Advanced migration strategies
- [`MIGRATION_QUICK_REF.md`](./MIGRATION_QUICK_REF.md) - Quick reference commands
### 2. Access the Services
- **API Documentation**: http://localhost:8001/docs
- **API Base URL**: http://localhost:8001/api/v1