Skip to content

Commit

Permalink
Single entrypoint.sh for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
ali-ramadhan committed Mar 28, 2021
1 parent b514d4b commit 27dd0a9
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 29 deletions.
3 changes: 2 additions & 1 deletion populate_development_env.bash
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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
6 changes: 3 additions & 3 deletions src/Dockerfile.prod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"]
# run entrypoint.sh
ENTRYPOINT ["/home/app/django/entrypoint.sh"]
13 changes: 0 additions & 13 deletions src/entrypoint.prod.sh

This file was deleted.

12 changes: 0 additions & 12 deletions src/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 "$@"

0 comments on commit 27dd0a9

Please sign in to comment.