- Add Woodpecker pipeline with base image support - Separate base image build (.woodpecker-base.yml) from app build (.woodpecker.yml) - Implement build/push separation in application pipeline - Create Docker base image with Python 3.11, Node.js 20, and bun - Update Dockerfile to use pre-built base image for faster builds - Remove GitHub Actions (not needed, using Woodpecker) - Fix Docker contexts and paths for new structure - Update docker-compose.yml build contexts - Fix rxconfig.py DB path for container environment - Add ArgoCD application manifests for staging/production - Create comprehensive documentation: - docs/WOODPECKER_CI_CD.md (CI/CD guide) - docs/BASE_IMAGE_MANAGEMENT.md (Base image management) - helm/peikarband/argocd/README.md (ArgoCD deployment) Benefits: - Build time: 8-10min → 2-3min (60-70% faster) - Better reliability (no repeated npm/bun downloads) - Separation of concerns (base vs application builds) - Full pipeline: check → build → push → verify → notify - Complete deployment automation with Helm + ArgoCD Pipeline stages: 1. check-base-image: Verify base image availability 2. build-image: Build application (no push) 3. push-image: Push with multi-tags (latest, sha, branch) 4. verify-push: Verify successful push 5. notify: Success/failure notifications Base image can be rebuilt via: - Manual trigger in Woodpecker UI - Auto trigger when Dockerfile.base changes
99 lines
2.3 KiB
YAML
99 lines
2.3 KiB
YAML
version: '3.8'
|
|
|
|
services:
|
|
# PostgreSQL Database
|
|
postgres:
|
|
image: postgres:14-alpine
|
|
container_name: peikarband-db
|
|
environment:
|
|
POSTGRES_USER: ${DB_USER:-peikarband}
|
|
POSTGRES_PASSWORD: ${DB_PASSWORD:-peikarband}
|
|
POSTGRES_DB: ${DB_NAME:-peikarband}
|
|
ports:
|
|
- "5432:5432"
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U peikarband"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
# Redis Cache
|
|
redis:
|
|
image: redis:7-alpine
|
|
container_name: peikarband-redis
|
|
ports:
|
|
- "6379:6379"
|
|
volumes:
|
|
- redis_data:/data
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
# Peikarband Application
|
|
app:
|
|
build:
|
|
context: ..
|
|
dockerfile: docker/Dockerfile
|
|
container_name: peikarband-app
|
|
depends_on:
|
|
- postgres
|
|
- redis
|
|
ports:
|
|
- "3000:3000"
|
|
- "8000:8000"
|
|
environment:
|
|
- DATABASE_URL=postgresql://peikarband:peikarband@postgres:5432/peikarband
|
|
- REDIS_URL=redis://redis:6379/0
|
|
- CELERY_BROKER_URL=redis://redis:6379/1
|
|
- CELERY_RESULT_BACKEND=redis://redis:6379/2
|
|
- SECRET_KEY=${SECRET_KEY}
|
|
- JWT_SECRET_KEY=${JWT_SECRET_KEY}
|
|
- ENVIRONMENT=production
|
|
volumes:
|
|
- ./:/app
|
|
restart: unless-stopped
|
|
|
|
# Celery Worker
|
|
celery:
|
|
build:
|
|
context: ..
|
|
dockerfile: docker/Dockerfile
|
|
container_name: peikarband-celery
|
|
command: celery -A src.infrastructure.tasks.celery_app worker -l info
|
|
depends_on:
|
|
- postgres
|
|
- redis
|
|
environment:
|
|
- DATABASE_URL=postgresql://peikarband:peikarband@postgres:5432/peikarband
|
|
- REDIS_URL=redis://redis:6379/0
|
|
- CELERY_BROKER_URL=redis://redis:6379/1
|
|
- CELERY_RESULT_BACKEND=redis://redis:6379/2
|
|
volumes:
|
|
- ./:/app
|
|
restart: unless-stopped
|
|
|
|
# Flower (Celery Monitoring)
|
|
flower:
|
|
build:
|
|
context: ..
|
|
dockerfile: docker/Dockerfile
|
|
container_name: peikarband-flower
|
|
command: celery -A src.infrastructure.tasks.celery_app flower
|
|
depends_on:
|
|
- redis
|
|
- celery
|
|
ports:
|
|
- "5555:5555"
|
|
environment:
|
|
- CELERY_BROKER_URL=redis://redis:6379/1
|
|
restart: unless-stopped
|
|
|
|
volumes:
|
|
postgres_data:
|
|
redis_data:
|
|
|