diff --git a/.env.dev b/.env.dev index d3d4861..cf44a97 100644 --- a/.env.dev +++ b/.env.dev @@ -11,14 +11,14 @@ DB_NAME=Development DB_USERNAME=postgres 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 REDIS_URL=redis://default:wHM2fSW8EXtsoTjHxLZyyaRsD8IJm4tOU108252rizfmUYrp709PuCLUhr9mmYDK@31.7.78.133:14353/0 -CELERY_BROKER_URL=rediss://default:wHM2fSW8EXtsoTjHxLZyyaRsD8IJm4tOU108252rizfmUYrp709PuCLUhr9mmYDK@31.7.78.133:14353/0 -CELERY_RESULT_BACKEND=rediss://default:wHM2fSW8EXtsoTjHxLZyyaRsD8IJm4tOU108252rizfmUYrp709PuCLUhr9mmYDK@31.7.78.133:14353/0 +CELERY_BROKER_URL=redis://default:wHM2fSW8EXtsoTjHxLZyyaRsD8IJm4tOU108252rizfmUYrp709PuCLUhr9mmYDK@31.7.78.133:14353/0 +CELERY_RESULT_BACKEND=redis://default:wHM2fSW8EXtsoTjHxLZyyaRsD8IJm4tOU108252rizfmUYrp709PuCLUhr9mmYDK@31.7.78.133:14353/0 CELERY_CACHE_BACKEND=default # Super user information diff --git a/Dockerfile b/Dockerfile index 9ada4a5..c3c0fe4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,4 +21,4 @@ COPY . /app/ EXPOSE 5000 -CMD ["python", "manage.py", "runserver", "0.0.0.0:5000"] \ No newline at end of file +CMD ["/entrypoint.sh"] \ No newline at end of file diff --git a/Rasaddam_Backend/settings.py b/Rasaddam_Backend/settings.py index 2ca33d7..b0a4cc1 100644 --- a/Rasaddam_Backend/settings.py +++ b/Rasaddam_Backend/settings.py @@ -116,7 +116,7 @@ WSGI_APPLICATION = 'Rasaddam_Backend.wsgi.application' MONGODB_DATABASES = { "default": { - "name": 'mongodb', + "name": '-', "host": "", "tz_aware": True, # if you using timezones in django (USE_TZ = True) # noqa }, diff --git a/entrypoint.sh b/entrypoint.sh index 3153bd3..a0098f6 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,6 +1,15 @@ #!/bin/sh -set -e + +echo "🚀 Make migrations..." python manage.py migrate --noinput + +echo "🚀 Applying database migrations..." +python manage.py migrate --noinput + +echo "🎯 Collect static files..." python manage.py collectstatic --noinput +echo "✅ Starting Django server..." +python manage.py runserver 0.0.0.0:5000 + exec "$@"