diff --git a/populate_development_env.bash b/populate_development_env.bash index bd68be4..e174c06 100644 --- a/populate_development_env.bash +++ b/populate_development_env.bash @@ -1,5 +1,6 @@ #!/bin/bash +# This might be dangerous... I once accidently flushed production lol. # echo "Flushing Django database..." # docker-compose exec django python manage.py flush --no-input @@ -10,4 +11,4 @@ echo "Populating Django database..." docker-compose exec django python manage.py loaddata lovelace_django_dumpdata.json echo "Collecting static files..." -python manage.py collectstatic --no-input +docker-compose exec django python manage.py collectstatic --no-input diff --git a/src/Dockerfile.prod b/src/Dockerfile.prod index 919e035..6c1b3c5 100644 --- a/src/Dockerfile.prod +++ b/src/Dockerfile.prod @@ -31,7 +31,7 @@ RUN pip install --upgrade pip &&\ pip install -r requirements.txt # copy entrypoint-prod.sh -COPY ./entrypoint.prod.sh $APP_HOME +COPY ./entrypoint.sh $APP_HOME # copy project COPY . $APP_HOME @@ -42,5 +42,5 @@ RUN chown -R app:app $APP_HOME # change to the app user USER app -# run entrypoint.prod.sh -ENTRYPOINT ["/home/app/django/entrypoint.prod.sh"] \ No newline at end of file +# run entrypoint.sh +ENTRYPOINT ["/home/app/django/entrypoint.sh"] diff --git a/src/entrypoint.prod.sh b/src/entrypoint.prod.sh deleted file mode 100755 index f719b8f..0000000 --- a/src/entrypoint.prod.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh - -if [ "$DATABASE" = "postgres" ] -then - while ! nc -z $SQL_HOST $SQL_PORT; do - echo "Waiting for postgres..." - sleep 1 - done - - echo "PostgreSQL started" -fi - -exec "$@" diff --git a/src/entrypoint.sh b/src/entrypoint.sh index eed196a..f719b8f 100755 --- a/src/entrypoint.sh +++ b/src/entrypoint.sh @@ -10,16 +10,4 @@ then echo "PostgreSQL started" fi -echo "Flushing Django database..." -python manage.py flush --no-input - -echo "Migrating Django changes..." -python manage.py migrate --no-input - -echo "Populating Django database..." -python manage.py loaddata lovelace_django_dumpdata.json - -echo "Collecting static files..." -python manage.py collectstatic --no-input - exec "$@"