first commit
This commit is contained in:
5
resources/scripts/backup.sh
Normal file
5
resources/scripts/backup.sh
Normal file
@@ -0,0 +1,5 @@
|
||||
file=/tmp/db-$(/usr/bin/date +\%Y-%m-%d-%H:%M:%S).sql
|
||||
container=postgres
|
||||
/usr/bin/docker container exec $container pg_dump -U postgres django > $file
|
||||
mc cp $file b2/buket-name
|
||||
rm $file
|
||||
17
resources/scripts/entrypoint-server.sh
Normal file
17
resources/scripts/entrypoint-server.sh
Normal file
@@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
|
||||
while ! nc -z db 5432; do
|
||||
sleep 2
|
||||
echo "Waiting postgress...."
|
||||
done
|
||||
|
||||
python3 manage.py collectstatic --noinput
|
||||
python3 manage.py migrate --noinput
|
||||
|
||||
gunicorn config.wsgi:application -b 0.0.0.0:8000 --workers $(($(nproc) * 2 + 1))
|
||||
|
||||
|
||||
|
||||
exit $?
|
||||
|
||||
|
||||
18
resources/scripts/entrypoint.sh
Normal file
18
resources/scripts/entrypoint.sh
Normal file
@@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
|
||||
while ! nc -z db 5432; do
|
||||
sleep 2
|
||||
echo "Waiting postgress...."
|
||||
done
|
||||
|
||||
|
||||
python3 manage.py collectstatic --noinput
|
||||
python3 manage.py migrate --noinput
|
||||
|
||||
uvicorn config.asgi:application --host 0.0.0.0 --port 8000 --reload --reload-dir core --reload-dir config
|
||||
|
||||
|
||||
|
||||
exit $?
|
||||
|
||||
|
||||
Reference in New Issue
Block a user