No description
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
amchk2025 573feb9127
All checks were successful
Deploy to VPS / deploy (push) Successful in 13m42s
added new initiatives code for SM
2026-07-08 22:01:00 +05:30
.forgejo/workflows updated deploy.yml 2026-07-04 12:02:00 +05:30
alerts lost prev repo :-( 2026-05-23 11:20:59 +05:30
coaching fixed some SM views 2026-07-08 19:26:44 +05:30
core final SM views 2026-07-07 12:06:06 +05:30
dashboards fixed kpi delta calculation 2026-07-02 10:09:44 +05:30
dealer_intelligence added sfp role 2026-05-31 09:00:36 +05:30
dealer_management added dealer management 2026-07-03 15:29:40 +05:30
dealer_scheme SM views done 2026-06-27 11:13:15 +05:30
execution added a new Execution page 2026-05-24 11:39:51 +05:30
field_activities final SM views 2026-07-07 12:06:06 +05:30
functional_health Added functional health screen for CH 2026-05-24 18:54:32 +05:30
hierarchy fixed scoping bugs 2026-07-02 09:54:59 +05:30
incentives added payout governance view for sfp 2026-05-31 11:26:31 +05:30
initiatives added new initiatives code for SM 2026-07-08 22:01:00 +05:30
insights insights working 2026-06-28 12:18:41 +05:30
kpi added sfp role 2026-05-31 09:00:36 +05:30
org_performance fixed up performance dashboard 2026-07-02 09:46:44 +05:30
outlet fixed up performance dashboard 2026-07-02 09:46:44 +05:30
recommendations lost prev repo :-( 2026-05-23 11:20:59 +05:30
sf_incentive added incentive tracking 2026-05-31 10:57:22 +05:30
sfa_backend added dealer management 2026-07-03 15:29:40 +05:30
spend Added Scheme Approval View 2026-05-28 10:32:11 +05:30
targets final SM views 2026-07-07 12:06:06 +05:30
tasks visits, joint working and escalations done 2026-06-27 12:36:55 +05:30
users added sfp role 2026-05-31 09:00:36 +05:30
visits new bcp wizard for SS 2026-07-05 22:07:18 +05:30
.dockerignore lost prev repo :-( 2026-05-23 11:20:59 +05:30
.env.example lost prev repo :-( 2026-05-23 11:20:59 +05:30
.gitignore lost prev repo :-( 2026-05-23 11:20:59 +05:30
db.sqlite3 added new initiatives code for SM 2026-07-08 22:01:00 +05:30
docker-compose.yml lost prev repo :-( 2026-05-23 11:20:59 +05:30
Dockerfile updated Dockerfile 2026-07-03 10:27:34 +05:30
entrypoint.sh lost prev repo :-( 2026-05-23 11:20:59 +05:30
manage.py lost prev repo :-( 2026-05-23 11:20:59 +05:30
README.md lost prev repo :-( 2026-05-23 11:20:59 +05:30
requirements.txt lost prev repo :-( 2026-05-23 11:20:59 +05:30

Docker Setup for CelcomDigi S&D Platform Backend

This setup provides a complete Dockerized environment for the Django REST API backend.

Quick Start

  1. Copy environment variables:

    cp .env.example .env
    
  2. Update the .env file with your configuration:

    nano .env
    
  3. Build and start the services:

    docker-compose up --build
    
  4. Access the application:

Services

  • api: Django REST API with Gunicorn
  • db: PostgreSQL database
  • redis: Redis cache/queue
  • worker: Background task processor

Environment Variables

Variable Description Default
SECRET_KEY Django secret key Required
DEBUG Debug mode False
ALLOWED_HOSTS Comma-separated hosts localhost
CORS_ALLOWED_ORIGINS CORS origins https://your-domain.com
DB_NAME Database name celcomdigi
DB_USER Database user postgres
DB_PASSWORD Database password Required
REDIS_URL Redis connection URL redis://redis:6379/1
CREATE_SUPERUSER Create superuser on start false
LOAD_SEED_DATA Load demo data false

Commands

Development

# Start services in background
docker-compose up -d

# View logs
docker-compose logs -f

# Stop services
docker-compose down

# Rebuild and restart
docker-compose up --build --force-recreate

Database Management

# Access database
docker-compose exec db psql -U postgres -d celcomdigi

# Run migrations
docker-compose exec api python manage.py migrate

# Create superuser
docker-compose exec api python manage.py createsuperuser

Development with Docker

# Run management commands
docker-compose exec api python manage.py <command>

# Access shell
docker-compose exec api python manage.py shell

# Run tests
docker-compose exec api python manage.py test

Production Deployment

  1. Set production environment variables in .env

  2. Build optimized image:

    docker build -t celcomdigi-backend .
    
  3. Use docker-compose.prod.yml for production:

    docker-compose -f docker-compose.prod.yml up -d
    

Health Check

The API includes a health check endpoint at:

  • GET /api/health/ - Returns health status

Data Persistence

  • Database: Data persists in Docker volumes (postgres_data)
  • Uploads: Media files stored in /app/uploads
  • Logs: Application logs in /app/logs

Troubleshooting

  1. Port conflicts: Change ports in docker-compose.yml
  2. Database connection: Ensure DB is ready before API starts
  3. Memory issues: Adjust worker count in Dockerfile
  4. Permission issues: Verify user permissions in Dockerfile

Security

  • Use strong passwords in .env
  • Set proper CORS origins
  • Use HTTPS in production
  • Regularly update dependencies