removed debug code and updated comments in firstRun script
This commit is contained in:
parent
3947583131
commit
0cffd02cdb
1 changed files with 3 additions and 6 deletions
|
@ -30,10 +30,7 @@ then
|
||||||
DATABASE_PASSWORD=$(tr -dc 'A-Za-z0-9' < /dev/urandom | head -c 15)
|
DATABASE_PASSWORD=$(tr -dc 'A-Za-z0-9' < /dev/urandom | head -c 15)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "user is $DATABASE_USERNAME"
|
# WRITE VARIABLES TO .ENV FILE
|
||||||
echo "pass is $DATABASE_PASSWORD"
|
|
||||||
echo "DATABASE_NAME is ${PROJECT_NAME}"
|
|
||||||
|
|
||||||
SECRET_KEY=$(tr -dc 'A-Za-z0-9' < /dev/urandom | head -c 50)
|
SECRET_KEY=$(tr -dc 'A-Za-z0-9' < /dev/urandom | head -c 50)
|
||||||
{
|
{
|
||||||
echo "DATABASE_HOST=${PROJECT_NAME}-db"
|
echo "DATABASE_HOST=${PROJECT_NAME}-db"
|
||||||
|
@ -44,6 +41,7 @@ SECRET_KEY=$(tr -dc 'A-Za-z0-9' < /dev/urandom | head -c 50)
|
||||||
echo "DJANGO_SECRET_KEY=${SECRET_KEY}"
|
echo "DJANGO_SECRET_KEY=${SECRET_KEY}"
|
||||||
} >> .env
|
} >> .env
|
||||||
|
|
||||||
|
# RENAME PROJECT DIRECTORY
|
||||||
if [ "$PROJECT_NAME" != "djangodocker" ]; then
|
if [ "$PROJECT_NAME" != "djangodocker" ]; then
|
||||||
mv djangodocker "$PROJECT_NAME"
|
mv djangodocker "$PROJECT_NAME"
|
||||||
fi
|
fi
|
||||||
|
@ -52,10 +50,9 @@ echo "===== STARTING DOCKER ====="
|
||||||
docker compose up -d --build
|
docker compose up -d --build
|
||||||
|
|
||||||
echo "===== MIGRATING DATABASE ====="
|
echo "===== MIGRATING DATABASE ====="
|
||||||
echo "Running: docker exec -ti ${PROJECT_NAME}-api ./manage.py migrate"
|
|
||||||
docker exec -ti "${PROJECT_NAME}-api" ./manage.py migrate
|
docker exec -ti "${PROJECT_NAME}-api" ./manage.py migrate
|
||||||
|
|
||||||
echo "===== CREATE SUPERUSER ====="
|
echo "===== CREATING SUPERUSER ====="
|
||||||
docker exec -ti "${PROJECT_NAME}-api" ./manage.py createsuperuser
|
docker exec -ti "${PROJECT_NAME}-api" ./manage.py createsuperuser
|
||||||
|
|
||||||
echo "Success! Go to http://localhost:8000 to see API documentation."
|
echo "Success! Go to http://localhost:8000 to see API documentation."
|
||||||
|
|
Loading…
Add table
Reference in a new issue