add entrypoint
This commit is contained in:
parent
a866a92443
commit
456402c5e5
@ -9,4 +9,10 @@ RUN pip install --upgrade pip
|
|||||||
COPY ./requirements.txt .
|
COPY ./requirements.txt .
|
||||||
RUN pip install -r requirements.txt
|
RUN pip install -r requirements.txt
|
||||||
|
|
||||||
COPY . .
|
COPY ./entrypoint.sh .
|
||||||
|
RUN sed -i 's/\r$//g' /usr/src/app/entrypoint.sh
|
||||||
|
RUN chmod +x /usr/src/app/entrypoint.sh
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
ENTRYPOINT ["/usr/src/app/entrypoint.sh"]
|
||||||
16
entrypoint.sh
Normal file
16
entrypoint.sh
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
|
||||||
|
if [ "$DATABASE" = "postgres" ]
|
||||||
|
then
|
||||||
|
echo "Waiting for postgres..."
|
||||||
|
|
||||||
|
while ! nc -z $SQL_HOST $SQL_PORT; do
|
||||||
|
sleep 0.1
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "PostgreSQL started"
|
||||||
|
fi
|
||||||
|
|
||||||
|
python manage.py flush --no-input
|
||||||
|
python manage.py migrate
|
||||||
|
|
||||||
|
exec "$@"
|
||||||
Loading…
x
Reference in New Issue
Block a user