Fix watchfiles spam and port conflicts

- Disabled auto-reload by default (ENABLE_RELOAD=false)
- Changed default ports: PostgreSQL 5433, API 8001
- Updated psycopg2-binary to 2.9.10 (Python 3.13 compat)
- Updated Pydantic to 2.10.3 (Python 3.13 compat)
- Added reload_excludes to prevent .git watching
- Updated .env.example with new defaults
This commit is contained in:
Christian 2025-12-05 14:42:18 +01:00
parent ab7adc441c
commit 23f8a3d2ae
5 changed files with 16 additions and 13 deletions

View File

@ -7,14 +7,14 @@ DATABASE_URL=postgresql://bmc_hub:bmc_hub@postgres:5432/bmc_hub
POSTGRES_USER=bmc_hub
POSTGRES_PASSWORD=bmc_hub
POSTGRES_DB=bmc_hub
POSTGRES_PORT=5432
POSTGRES_PORT=5433 # Changed from 5432 to avoid conflicts with other services
# =====================================================
# API CONFIGURATION
# =====================================================
API_HOST=0.0.0.0
API_PORT=8000
API_RELOAD=true
API_PORT=8001 # Changed from 8000 to avoid conflicts with other services
ENABLE_RELOAD=false # Set to true for live code reload (causes log spam in Docker)
# =====================================================
# SECURITY

View File

@ -6,6 +6,8 @@ WORKDIR /app
RUN apt-get update && apt-get install -y \
curl \
git \
libpq-dev \
gcc \
&& rm -rf /var/lib/apt/lists/*
# Build arguments for GitHub release deployment

View File

@ -13,7 +13,7 @@ services:
- postgres_data:/var/lib/postgresql/data
- ./migrations/init.sql:/docker-entrypoint-initdb.d/init.sql:ro
ports:
- "${POSTGRES_PORT:-5432}:5432"
- "${POSTGRES_PORT:-5433}:5432"
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-bmc_hub}"]
@ -33,7 +33,7 @@ services:
postgres:
condition: service_healthy
ports:
- "${API_PORT:-8000}:8000"
- "${API_PORT:-8001}:8000"
volumes:
- ./logs:/app/logs
- ./uploads:/app/uploads
@ -47,7 +47,7 @@ services:
environment:
# Override database URL to point to postgres service
- DATABASE_URL=postgresql://${POSTGRES_USER:-bmc_hub}:${POSTGRES_PASSWORD:-bmc_hub}@postgres:5432/${POSTGRES_DB:-bmc_hub}
- ENABLE_RELOAD=true
- ENABLE_RELOAD=false
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]

View File

@ -111,6 +111,7 @@ if __name__ == "__main__":
reload=True,
reload_includes=["*.py"],
reload_dirs=["app"],
reload_excludes=[".git/*", "*.pyc", "__pycache__/*", "logs/*", "uploads/*", "data/*"],
log_level="info"
)
else:

View File

@ -1,7 +1,7 @@
fastapi==0.109.0
uvicorn[standard]==0.27.0
psycopg2-binary==2.9.9
pydantic==2.5.3
pydantic-settings==2.1.0
python-dotenv==1.0.0
python-multipart==0.0.6
fastapi==0.115.0
uvicorn[standard]==0.32.1
psycopg2-binary==2.9.10
pydantic==2.10.3
pydantic-settings==2.6.1
python-dotenv==1.0.1
python-multipart==0.0.17