automate migrations in docker

This commit is contained in:
2025-10-19 10:46:44 +03:30
parent 48b4894c13
commit fe1115dbd3
4 changed files with 15 additions and 6 deletions

View File

@@ -11,14 +11,14 @@ DB_NAME=Development
DB_USERNAME=postgres DB_USERNAME=postgres
DB_PASSWORD=pfLIVXupbDetvFMt2gUvxLXUL9b4HIOHaPcKXsBEZ1i8zl0iLUjmhUfXlGfJKcTV DB_PASSWORD=pfLIVXupbDetvFMt2gUvxLXUL9b4HIOHaPcKXsBEZ1i8zl0iLUjmhUfXlGfJKcTV
ENV RUNNING_IN_DOCKER=1 RUNNING_IN_DOCKER=1
CORS_ALLOWED_ORIGINS=http://localhost:8080,http://127.0.0.1:8080,http://127.0.0.1:3000,http://localhost:3000,http://192.168.88.130:3000,https://rasadyar.net,https://rasaddam-front.liara.run,https://dam.rasadyar.net,https://dam.rasadyar.com,https://api.dam.rasadyar.com CORS_ALLOWED_ORIGINS=http://localhost:8080,http://127.0.0.1:8080,http://127.0.0.1:3000,http://localhost:3000,http://192.168.88.130:3000,https://rasadyar.net,https://rasaddam-front.liara.run,https://dam.rasadyar.net,https://dam.rasadyar.com,https://api.dam.rasadyar.com
REDIS_URL=redis://default:wHM2fSW8EXtsoTjHxLZyyaRsD8IJm4tOU108252rizfmUYrp709PuCLUhr9mmYDK@31.7.78.133:14353/0 REDIS_URL=redis://default:wHM2fSW8EXtsoTjHxLZyyaRsD8IJm4tOU108252rizfmUYrp709PuCLUhr9mmYDK@31.7.78.133:14353/0
CELERY_BROKER_URL=rediss://default:wHM2fSW8EXtsoTjHxLZyyaRsD8IJm4tOU108252rizfmUYrp709PuCLUhr9mmYDK@31.7.78.133:14353/0 CELERY_BROKER_URL=redis://default:wHM2fSW8EXtsoTjHxLZyyaRsD8IJm4tOU108252rizfmUYrp709PuCLUhr9mmYDK@31.7.78.133:14353/0
CELERY_RESULT_BACKEND=rediss://default:wHM2fSW8EXtsoTjHxLZyyaRsD8IJm4tOU108252rizfmUYrp709PuCLUhr9mmYDK@31.7.78.133:14353/0 CELERY_RESULT_BACKEND=redis://default:wHM2fSW8EXtsoTjHxLZyyaRsD8IJm4tOU108252rizfmUYrp709PuCLUhr9mmYDK@31.7.78.133:14353/0
CELERY_CACHE_BACKEND=default CELERY_CACHE_BACKEND=default
# Super user information # Super user information

View File

@@ -21,4 +21,4 @@ COPY . /app/
EXPOSE 5000 EXPOSE 5000
CMD ["python", "manage.py", "runserver", "0.0.0.0:5000"] CMD ["/entrypoint.sh"]

View File

@@ -116,7 +116,7 @@ WSGI_APPLICATION = 'Rasaddam_Backend.wsgi.application'
MONGODB_DATABASES = { MONGODB_DATABASES = {
"default": { "default": {
"name": 'mongodb', "name": '-',
"host": "", "host": "",
"tz_aware": True, # if you using timezones in django (USE_TZ = True) # noqa "tz_aware": True, # if you using timezones in django (USE_TZ = True) # noqa
}, },

View File

@@ -1,6 +1,15 @@
#!/bin/sh #!/bin/sh
set -e
echo "🚀 Make migrations..."
python manage.py migrate --noinput python manage.py migrate --noinput
echo "🚀 Applying database migrations..."
python manage.py migrate --noinput
echo "🎯 Collect static files..."
python manage.py collectstatic --noinput python manage.py collectstatic --noinput
echo "✅ Starting Django server..."
python manage.py runserver 0.0.0.0:5000
exec "$@" exec "$@"