feat: improve CI/CD and make config environment-aware
Some checks failed
CD - Build & Deploy / build-and-push (push) Has been cancelled
CD - Build & Deploy / package-helm (push) Has been cancelled
CD - Build & Deploy / deploy-staging (push) Has been cancelled
CD - Build & Deploy / deploy-production (push) Has been cancelled
CD - Build & Deploy / release (push) Has been cancelled
CI / test (3.11) (push) Has been cancelled
CI / test (3.12) (push) Has been cancelled
CI / security (push) Has been cancelled
ci/woodpecker/push/woodpecker Pipeline failed

CI/CD Improvements (.woodpecker.yml):
- Add build_args for VERSION, BUILD_DATE, PYTHON_VERSION, NODE_VERSION
- Add OCI labels for better image metadata
- Enable cache_from for faster builds
- Enable provenance for supply chain security

Configuration Improvements (rxconfig.py):
- Make API_URL configurable via environment (was hardcoded localhost)
- Make ports configurable via FRONTEND_PORT, BACKEND_PORT env vars
- Make DATABASE_URL configurable via environment
- Support both development (SQLite) and production (PostgreSQL) setups

Benefits:
- Better CI cache utilization
- Proper image versioning and metadata
- Easier deployment to different environments
- No code changes needed for prod vs dev
This commit is contained in:
Ehsan.Asadi
2025-12-30 16:32:13 +03:30
parent 0480400078
commit aa55cd9cd9
2 changed files with 30 additions and 4 deletions

View File

@@ -3,14 +3,21 @@
This file configures the Reflex application settings.
"""
import os
import reflex as rx
# Environment-aware configuration
API_URL = os.getenv("API_URL", "http://localhost:8000")
FRONTEND_PORT = int(os.getenv("FRONTEND_PORT", "3000"))
BACKEND_PORT = int(os.getenv("BACKEND_PORT", "8000"))
DB_URL = os.getenv("DATABASE_URL", "sqlite:///reflex.db")
config = rx.Config(
app_name="peikarband",
api_url="http://localhost:8000",
frontend_port=3000,
backend_port=8000,
db_url="sqlite:///reflex.db", # Temporary, will use PostgreSQL
api_url=API_URL,
frontend_port=FRONTEND_PORT,
backend_port=BACKEND_PORT,
db_url=DB_URL,
disable_plugins=["reflex.plugins.sitemap.SitemapPlugin"],
stylesheets=[
"https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap",