Refactor application ports to 12000 for backend and 12001 for frontend; update documentation and configuration files accordingly
Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
@@ -2,6 +2,30 @@
|
||||
|
||||
This guide covers deploying `ai.allucanget.biz` using [Coolify](https://coolify.io) from the repository `https://git.allucanget.biz/allucanget/ai.allucanget.biz.git`.
|
||||
|
||||
## Deployment Options
|
||||
|
||||
The application supports two deployment approaches:
|
||||
|
||||
### Option 1: Docker Compose (Recommended)
|
||||
|
||||
- **Best for**: Local development, consistent environments, simplified deployment
|
||||
- **See**: [Docker Compose Deployment Guide](./docker-compose.md)
|
||||
- **Key benefits**:
|
||||
- Same containerized environment locally and in production
|
||||
- Built-in service orchestration and networking
|
||||
- Easy volume management for data persistence
|
||||
- Better debugging and log viewing
|
||||
|
||||
### Option 2: Coolify with Nixpacks (Alternative)
|
||||
|
||||
- **Best for**: Existing Coolify installations, serverless deployments
|
||||
- **Key differences**:
|
||||
- Uses Coolify's Nixpacks build system instead of Docker
|
||||
- Requires separate services setup in Coolify UI
|
||||
- Manual environment variable configuration per service
|
||||
|
||||
This guide covers **Option 2 (Nixpacks)**. For **Option 1 (Docker Compose)**, see the [Docker Compose Deployment Guide](./docker-compose.md).
|
||||
|
||||
## Architecture Overview
|
||||
|
||||
The application consists of two Python services:
|
||||
@@ -9,12 +33,12 @@ The application consists of two Python services:
|
||||
| Service | Framework | Port | Description |
|
||||
| -------- | ----------------- | ----- | ------------------------------------------ |
|
||||
| Backend | FastAPI + uvicorn | 12000 | REST API, auth, AI generation, DuckDB |
|
||||
| Frontend | Flask + gunicorn | 5000 | SSR web UI, session auth, proxy to backend |
|
||||
| Frontend | Flask + gunicorn | 12001 | SSR web UI, session auth, proxy to backend |
|
||||
|
||||
Coolify's built-in reverse proxy routes traffic:
|
||||
|
||||
- `/api/*` → Backend (port 12000)
|
||||
- `/` → Frontend (port 5000)
|
||||
- `/` → Frontend (port 12001)
|
||||
|
||||
## Prerequisites
|
||||
|
||||
@@ -58,10 +82,10 @@ Add these as **Runtime** environment variables in Coolify:
|
||||
3. Choose the `main` branch
|
||||
4. Set **Build Pack** to `nixpacks`
|
||||
5. **CRITICAL: Set Base Directory to `/frontend`** — this tells Nixpacks to look in the `frontend/` subdirectory for `requirements.txt` and the Python application
|
||||
6. Set **Ports Exposed** to `5000`
|
||||
6. Set **Ports Exposed** to `12001`
|
||||
7. Set **Start Command** to:
|
||||
```txt
|
||||
gunicorn app.main:app --bind 0.0.0.0:5000 --workers 2 --timeout 120
|
||||
gunicorn app.main:app --bind 0.0.0.0:12001 --workers 2 --timeout 120
|
||||
```
|
||||
8. Click **Create Resource**
|
||||
|
||||
@@ -91,7 +115,7 @@ Coolify provides a built-in reverse proxy. Configure routing rules:
|
||||
### Frontend Proxy Rules
|
||||
|
||||
- **Domain**: `ai.allucanget.biz`
|
||||
- **Port**: `5000`
|
||||
- **Port**: `12001`
|
||||
- **Path**: `/` → forward to frontend
|
||||
|
||||
### Nginx Configuration (Optional)
|
||||
@@ -113,7 +137,7 @@ location /api/ {
|
||||
|
||||
# Frontend proxy
|
||||
location / {
|
||||
proxy_pass http://frontend:5000;
|
||||
proxy_pass http://frontend:12001;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
|
||||
Reference in New Issue
Block a user