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:
parent
ab7adc441c
commit
23f8a3d2ae
@ -7,14 +7,14 @@ DATABASE_URL=postgresql://bmc_hub:bmc_hub@postgres:5432/bmc_hub
|
|||||||
POSTGRES_USER=bmc_hub
|
POSTGRES_USER=bmc_hub
|
||||||
POSTGRES_PASSWORD=bmc_hub
|
POSTGRES_PASSWORD=bmc_hub
|
||||||
POSTGRES_DB=bmc_hub
|
POSTGRES_DB=bmc_hub
|
||||||
POSTGRES_PORT=5432
|
POSTGRES_PORT=5433 # Changed from 5432 to avoid conflicts with other services
|
||||||
|
|
||||||
# =====================================================
|
# =====================================================
|
||||||
# API CONFIGURATION
|
# API CONFIGURATION
|
||||||
# =====================================================
|
# =====================================================
|
||||||
API_HOST=0.0.0.0
|
API_HOST=0.0.0.0
|
||||||
API_PORT=8000
|
API_PORT=8001 # Changed from 8000 to avoid conflicts with other services
|
||||||
API_RELOAD=true
|
ENABLE_RELOAD=false # Set to true for live code reload (causes log spam in Docker)
|
||||||
|
|
||||||
# =====================================================
|
# =====================================================
|
||||||
# SECURITY
|
# SECURITY
|
||||||
|
|||||||
@ -6,6 +6,8 @@ WORKDIR /app
|
|||||||
RUN apt-get update && apt-get install -y \
|
RUN apt-get update && apt-get install -y \
|
||||||
curl \
|
curl \
|
||||||
git \
|
git \
|
||||||
|
libpq-dev \
|
||||||
|
gcc \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# Build arguments for GitHub release deployment
|
# Build arguments for GitHub release deployment
|
||||||
|
|||||||
@ -13,7 +13,7 @@ services:
|
|||||||
- postgres_data:/var/lib/postgresql/data
|
- postgres_data:/var/lib/postgresql/data
|
||||||
- ./migrations/init.sql:/docker-entrypoint-initdb.d/init.sql:ro
|
- ./migrations/init.sql:/docker-entrypoint-initdb.d/init.sql:ro
|
||||||
ports:
|
ports:
|
||||||
- "${POSTGRES_PORT:-5432}:5432"
|
- "${POSTGRES_PORT:-5433}:5432"
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-bmc_hub}"]
|
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-bmc_hub}"]
|
||||||
@ -33,7 +33,7 @@ services:
|
|||||||
postgres:
|
postgres:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
ports:
|
ports:
|
||||||
- "${API_PORT:-8000}:8000"
|
- "${API_PORT:-8001}:8000"
|
||||||
volumes:
|
volumes:
|
||||||
- ./logs:/app/logs
|
- ./logs:/app/logs
|
||||||
- ./uploads:/app/uploads
|
- ./uploads:/app/uploads
|
||||||
@ -47,7 +47,7 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
# Override database URL to point to postgres service
|
# 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}
|
- 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
|
restart: unless-stopped
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
|
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
|
||||||
|
|||||||
1
main.py
1
main.py
@ -111,6 +111,7 @@ if __name__ == "__main__":
|
|||||||
reload=True,
|
reload=True,
|
||||||
reload_includes=["*.py"],
|
reload_includes=["*.py"],
|
||||||
reload_dirs=["app"],
|
reload_dirs=["app"],
|
||||||
|
reload_excludes=[".git/*", "*.pyc", "__pycache__/*", "logs/*", "uploads/*", "data/*"],
|
||||||
log_level="info"
|
log_level="info"
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
fastapi==0.109.0
|
fastapi==0.115.0
|
||||||
uvicorn[standard]==0.27.0
|
uvicorn[standard]==0.32.1
|
||||||
psycopg2-binary==2.9.9
|
psycopg2-binary==2.9.10
|
||||||
pydantic==2.5.3
|
pydantic==2.10.3
|
||||||
pydantic-settings==2.1.0
|
pydantic-settings==2.6.1
|
||||||
python-dotenv==1.0.0
|
python-dotenv==1.0.1
|
||||||
python-multipart==0.0.6
|
python-multipart==0.0.17
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user