调整docker相关文件名

This commit is contained in:
yangjian 2021-02-23 22:38:20 +08:00
parent 4ecb00327c
commit 2a39c2c77e
2 changed files with 22 additions and 22 deletions

View File

@ -17,4 +17,4 @@ RUN set -x \
&& apk del .build-deps \
&& rm -rf /var/cache/apk/*
ENTRYPOINT ["./mrdoc.sh"]
ENTRYPOINT ["./docker_mrdoc.sh"]

View File

@ -1,22 +1,22 @@
#!/bin/sh
python /app/MrDoc/manage.py makemigrations && python /app/MrDoc/manage.py migrate && echo y |python /app/MrDoc/manage.py rebuild_index
MM=`pwgen -1s`
CREATE_USER=1
if [ $CREATE_USER -eq 1 ]; then
if [ ! -e $CREATE_USER ]; then
touch $CREATE_USER
echo "-- First container startup --user:${USER} pwd:${MM}"
echo "from django.contrib.auth import get_user_model; User = get_user_model(); User.objects.create_superuser('${USER}', 'www@mrdoc.fun', '${MM}')" | python /app/MrDoc/manage.py shell
# YOUR_JUST_ONCE_LOGIC_HERE
else
echo "-- Not first container startup --"
fi
else
echo "user switch not create"
fi
python -u /app/MrDoc/manage.py runserver --noreload 0.0.0.0:${LISTEN_PORT}
#!/bin/sh
python /app/MrDoc/manage.py makemigrations && python /app/MrDoc/manage.py migrate && echo y |python /app/MrDoc/manage.py rebuild_index
MM=`pwgen -1s`
CREATE_USER=1
if [ $CREATE_USER -eq 1 ]; then
if [ ! -e $CREATE_USER ]; then
touch $CREATE_USER
echo "-- First container startup --user:${USER} pwd:${MM}"
echo "from django.contrib.auth import get_user_model; User = get_user_model(); User.objects.create_superuser('${USER}', 'www@mrdoc.fun', '${MM}')" | python /app/MrDoc/manage.py shell
# YOUR_JUST_ONCE_LOGIC_HERE
else
echo "-- Not first container startup --"
fi
else
echo "user switch not create"
fi
python -u /app/MrDoc/manage.py runserver --noreload 0.0.0.0:${LISTEN_PORT}
exec "$@"