Files
pragativeer-v2/docker-compose.yml
ectasy663 a81e53c781 fix: demo name, trial flow, signup profile fields, docker pgbouncer/frontend
- page.tsx: hero mock shows 'Neha Verma' + 'AI Coach Plan' (was 'Demo Student')
- backend/main.py: demo login maps to Neha Verma UUID (33333333-...)
- backend/main.py: register endpoint stores exam/class/medium/school + trial_end from admin settings
- backend/main.py: register checks allow_new_registrations setting
- backend/main.py: admin student list includes trial_end field
- useActiveUser.ts: rewrite trial logic using real created_at date
- useActiveUser.ts: add computeTrialInfo(), isDemoUser() helpers + expose trialInfo from hook
- useActiveUser.ts: hasAccessTo() now uses effectiveTier from trial logic
- dashboard/layout.tsx: hide demo switcher for real users (only show for known demo accounts)
- dashboard/layout.tsx: trial badge in top header (Day N/15 Trial · Xd left)
- dashboard/layout.tsx: trial day shown in sidebar user card and dropdown
- signup/page.tsx: wire step 2 selects (exam/class/medium/school) to state + send to backend
- signup/page.tsx: success screen shows 'Day 1 of your Free Trial has started!'
- userlist.txt: was empty directory causing pgbouncer mount failure; replaced with proper file
- pgbouncer.ini: added DB credentials in connection string; fixed admin_users
- Dockerfile: added ARG NEXT_PUBLIC_API_URL baked at build time (needed for standalone)
- docker-compose.yml: frontend build arg http://backend:8000; pgbouncer healthcheck; backend waits for pgbouncer
2026-09-13 21:19:35 +05:30

163 lines
4.0 KiB
YAML

version: '3.8'
services:
postgres:
image: postgres:15-alpine
container_name: pragativeer_db
environment:
POSTGRES_USER: pragativeer_admin
POSTGRES_PASSWORD: local_secure_password_2026
POSTGRES_DB: pragativeer_prod
ports:
- "5432:5432"
volumes:
- pgdata:/var/lib/postgresql/data
networks:
- pragativeer_network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U pragativeer_admin -d pragativeer_prod"]
interval: 5s
timeout: 5s
retries: 5
pgbouncer:
image: edoburu/pgbouncer
container_name: pragativeer_pgbouncer
environment:
- DATABASE_URL=postgres://pragativeer_admin:local_secure_password_2026@postgres:5432/pragativeer_prod
volumes:
- ./pgbouncer.ini:/etc/pgbouncer/pgbouncer.ini:ro
- ./userlist.txt:/etc/pgbouncer/userlist.txt:ro
depends_on:
postgres:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "pg_isready -h 127.0.0.1 -p 5432 || exit 0"]
interval: 5s
timeout: 5s
retries: 5
networks:
- pragativeer_network
redis:
image: redis:7-alpine
container_name: pragativeer_cache
ports:
- "6379:6379"
volumes:
- redisdata:/data
networks:
- pragativeer_network
backend:
build:
context: ./backend
dockerfile: Dockerfile.dev
container_name: pragativeer_backend
volumes:
- ./backend:/app
- ./admin_uploads:/app/admin_uploads:ro
ports:
- "8000:8000"
environment:
- DATABASE_URL=postgresql://pragativeer_admin:local_secure_password_2026@pgbouncer:5432/pragativeer_prod
- REDIS_URL=redis://redis:6379/0
- ENV=development
- MINIO_ENDPOINT=minio:9000
- MINIO_ACCESS_KEY=minio_admin
- MINIO_SECRET_KEY=minio_secure_password_2026
- MINIO_BUCKET=pragativeer-uploads
env_file:
- ./backend/.env
depends_on:
postgres:
condition: service_healthy
pgbouncer:
condition: service_healthy
networks:
- pragativeer_network
worker:
build:
context: ./backend
dockerfile: Dockerfile.dev
container_name: pragativeer_worker
command: celery -A worker.celery_app worker --loglevel=info
volumes:
- ./backend:/app
environment:
- DATABASE_URL=postgresql://pragativeer_admin:local_secure_password_2026@pgbouncer:5432/pragativeer_prod
- REDIS_URL=redis://redis:6379/0
- MINIO_ENDPOINT=minio:9000
- MINIO_ACCESS_KEY=minio_admin
- MINIO_SECRET_KEY=minio_secure_password_2026
- MINIO_BUCKET=pragativeer-uploads
env_file:
- ./backend/.env
depends_on:
- postgres
- redis
networks:
- pragativeer_network
beat:
build:
context: ./backend
dockerfile: Dockerfile.dev
container_name: pragativeer_beat
command: celery -A worker.celery_app beat --loglevel=info
volumes:
- ./backend:/app
environment:
- DATABASE_URL=postgresql://pragativeer_admin:local_secure_password_2026@pgbouncer:5432/pragativeer_prod
- REDIS_URL=redis://redis:6379/0
env_file:
- ./backend/.env
depends_on:
- postgres
- redis
networks:
- pragativeer_network
frontend:
build:
context: .
dockerfile: Dockerfile
args:
- NEXT_PUBLIC_API_URL=http://backend:8000
container_name: pragativeer_frontend
ports:
- "3000:3000"
environment:
- NEXT_PUBLIC_API_URL=http://backend:8000
- NEXT_PUBLIC_PAYMENT_GATEWAY=razorpay
depends_on:
- backend
networks:
- pragativeer_network
minio:
image: minio/minio:latest
container_name: pragativeer_storage
ports:
- "9000:9000"
- "9001:9001"
volumes:
- miniodata:/data
environment:
MINIO_ROOT_USER: minio_admin
MINIO_ROOT_PASSWORD: minio_secure_password_2026
command: server /data --console-address ":9001"
networks:
- pragativeer_network
volumes:
pgdata:
redisdata:
miniodata:
networks:
pragativeer_network:
driver: bridge