Update service ports in documentation and configuration files to 12000 for backend

This commit is contained in:
2026-04-27 21:35:35 +02:00
parent 8f4d01d34d
commit 80999b3659
5 changed files with 23 additions and 33 deletions
+14 -24
View File
@@ -6,14 +6,14 @@ This guide covers deploying `ai.allucanget.biz` using [Coolify](https://coolify.
The application consists of two Python services:
| Service | Framework | Port | Description |
| -------- | ----------------- | ---- | ------------------------------------------ |
| Backend | FastAPI + uvicorn | 8000 | REST API, auth, AI generation, DuckDB |
| Frontend | Flask + gunicorn | 5000 | SSR web UI, session auth, proxy to backend |
| 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 |
Coolify's built-in reverse proxy routes traffic:
- `/api/*` → Backend (port 8000)
- `/api/*` → Backend (port 12000)
- `/` → Frontend (port 5000)
## Prerequisites
@@ -30,10 +30,10 @@ Coolify's built-in reverse proxy routes traffic:
4. Choose the `main` branch
5. Set **Build Pack** to `nixpacks`
6. **CRITICAL: Set Base Directory to `/backend`** — this tells Nixpacks to look in the `backend/` subdirectory for `requirements.txt` and the Python application
7. Set **Ports Exposed** to `8000`
7. Set **Ports Exposed** to `12000`
8. Set **Start Command** to:
```txt
uvicorn app.main:app --host 0.0.0.0 --port 8000
uvicorn app.main:app --host 0.0.0.0 --port 12000
```
9. Click **Create Resource**
@@ -73,10 +73,10 @@ Add these as **Runtime** environment variables in Coolify:
Add these as **Runtime** environment variables in Coolify:
| Variable | Description | Example |
| ------------------ | ----------------------------------------- | -------------------------------------------------------------- |
| `FLASK_SECRET_KEY` | Flask session cookie signing key | Generate with `openssl rand -hex 32` |
| `BACKEND_URL` | Internal URL to reach the backend service | `http://localhost:8000` (or use Coolify's internal networking) |
| Variable | Description | Example |
| ------------------ | ----------------------------------------- | --------------------------------------------------------------- |
| `FLASK_SECRET_KEY` | Flask session cookie signing key | Generate with `openssl rand -hex 32` |
| `BACKEND_URL` | Internal URL to reach the backend service | `http://localhost:12000` (or use Coolify's internal networking) |
## Step 3: Configure Reverse Proxy
@@ -85,7 +85,7 @@ Coolify provides a built-in reverse proxy. Configure routing rules:
### Backend Proxy Rules
- **Domain**: `api.ai.allucanget.biz` (or subdomain of your choice)
- **Port**: `8000`
- **Port**: `12000`
- **Path**: `/api/*` → forward to backend
### Frontend Proxy Rules
@@ -104,7 +104,7 @@ If you need custom Nginx configuration, create `nginx/coolify.conf`:
# Backend API proxy
location /api/ {
proxy_pass http://backend:8000;
proxy_pass http://backend:12000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
@@ -152,7 +152,7 @@ If you want to persist DuckDB data:
### Frontend can't reach backend
- Ensure `BACKEND_URL` points to the correct internal URL
- If both services are on the same Coolify server, use `http://localhost:8000`
- If both services are on the same Coolify server, use `http://localhost:12000`
- Check that the backend service is running and healthy
### CORS errors
@@ -191,13 +191,3 @@ All required environment variables:
- [ ] Domain names configured
- [ ] Health checks passing
- [ ] Logs reviewed for errors
## Nixpacks Configuration
The project includes Nixpacks configuration files for both services:
- `nixpacks.toml` — Shared configuration (Python version, packages)
- `backend/nixpacks.toml` — Backend-specific (uvicorn, port 8000)
- `frontend/nixpacks.toml` — Frontend-specific (gunicorn, port 5000)
Nixpacks automatically detects Python projects and installs dependencies from `requirements.txt`. No additional configuration is needed for basic deployments.