Initial Django project setup for Postgres cluster management - Created Django project structure with postgres_handholder main app - Added clusters, backups, and monitoring apps - Implemented comprehensive models for PostgresCluster, PostgresInstance, ClusterUser, ClusterDatabase - Added forms and views for cluster management - Created Bootstrap 5 templates with modern UI - Added Docker and Docker Compose configuration - Included Celery for background tasks - Added comprehensive requirements.txt with all dependencies - Updated README with installation and usage instructions - Added environment configuration example - Set up proper URL routing and app structure

This commit is contained in:
2025-06-18 06:24:56 +02:00
parent b1d9ec8ec0
commit a856fb73f7
26 changed files with 1577 additions and 1 deletions

102
docker-compose.yml Normal file
View File

@ -0,0 +1,102 @@
version: '3.8'
services:
# PostgreSQL database for the Django app
db:
image: postgres:15
environment:
POSTGRES_DB: postgres_handholder
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
# Redis for Celery
redis:
image: redis:7-alpine
ports:
- "6379:6379"
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
# Django web application
web:
build: .
command: python manage.py runserver 0.0.0.0:8000
volumes:
- .:/app
- static_volume:/app/staticfiles
- media_volume:/app/media
ports:
- "8000:8000"
environment:
- DEBUG=True
- DB_HOST=db
- DB_NAME=postgres_handholder
- DB_USER=postgres
- DB_PASSWORD=postgres
- CELERY_BROKER_URL=redis://redis:6379/0
- CELERY_RESULT_BACKEND=redis://redis:6379/0
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
# Celery worker
celery:
build: .
command: celery -A postgres_handholder worker -l info
volumes:
- .:/app
environment:
- DEBUG=True
- DB_HOST=db
- DB_NAME=postgres_handholder
- DB_USER=postgres
- DB_PASSWORD=postgres
- CELERY_BROKER_URL=redis://redis:6379/0
- CELERY_RESULT_BACKEND=redis://redis:6379/0
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
# Celery beat scheduler
celery-beat:
build: .
command: celery -A postgres_handholder beat -l info
volumes:
- .:/app
environment:
- DEBUG=True
- DB_HOST=db
- DB_NAME=postgres_handholder
- DB_USER=postgres
- DB_PASSWORD=postgres
- CELERY_BROKER_URL=redis://redis:6379/0
- CELERY_RESULT_BACKEND=redis://redis:6379/0
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
volumes:
postgres_data:
redis_data:
static_volume:
media_volume: