Add entrypoint script with wait function for db.
This commit is contained in:
@ -17,4 +17,10 @@ RUN pipenv install --skip-lock --system --dev
|
||||
# copy project
|
||||
COPY . /usr/src/app/
|
||||
|
||||
# add wait for it
|
||||
RUN git clone https://github.com/vishnubob/wait-for-it.git /wait-for-it
|
||||
RUN chmod a+x /wait-for-it/wait-for-it.sh
|
||||
|
||||
# add entry point
|
||||
ADD ./django-entrypoint.sh /django-entrypoint.sh
|
||||
RUN chmod a+x /django-entrypoint.sh
|
||||
|
6
app/django-entrypoint.sh
Normal file
6
app/django-entrypoint.sh
Normal file
@ -0,0 +1,6 @@
|
||||
#!/bin/bash -x
|
||||
|
||||
python manage.py collectstatic --noinput
|
||||
python manage.py makemigrations --noinput
|
||||
python manage.py migrate --noinput
|
||||
exec "$@"
|
Reference in New Issue
Block a user