modern-django-starter/docker-compose.dokploy-simple.yml
amitrana01 3827944aa5 Add bulletproof startup script to fix django_site migration issues
- Create startup.sh with proper step-by-step setup and clear logging
- Explicit sites migration before configure_site command
- Better error handling with set -e
- Clean command structure in docker-compose
- This should resolve the 'relation django_site does not exist' error

The startup script runs migrations in correct order and provides clear feedback.
2025-09-11 18:42:15 +05:30

40 lines
1.1 KiB
YAML

services:
web:
build: .
ports:
- "8000:8000"
environment:
- DEBUG=True
- ALLOWED_HOSTS=dt.netcoptech.com,localhost,127.0.0.1
- DATABASE_URL=${DATABASE_URL:-postgresql://django_user:django_password@db:5432/django_db}
- SECRET_KEY=${SECRET_KEY:-django-insecure-change-this-key}
- DJANGO_SETTINGS_MODULE=django_project.settings.production
- CSRF_TRUSTED_ORIGINS=https://dt.netcoptech.com,http://dt.netcoptech.com
- SECURE_SSL_REDIRECT=False
- GOOGLE_OAUTH2_CLIENT_ID=${GOOGLE_OAUTH2_CLIENT_ID:-demo-google-client-id}
- GOOGLE_OAUTH2_CLIENT_SECRET=${GOOGLE_OAUTH2_CLIENT_SECRET:-demo-google-client-secret}
depends_on:
- db
networks:
- dokploy-network
command: >
sh -c "chmod +x /app/startup.sh && /app/startup.sh"
db:
image: postgres:15-alpine
environment:
- POSTGRES_DB=django_db
- POSTGRES_USER=django_user
- POSTGRES_PASSWORD=django_password
volumes:
- postgres_data:/var/lib/postgresql/data/
networks:
- dokploy-network
volumes:
postgres_data:
networks:
dokploy-network:
external: true