se agrega start-ssh.sh para el servicio ssh en docker
parent
5f13f91ea4
commit
5d208aee78
|
@ -0,0 +1,37 @@
|
|||
#!/bin/sh
|
||||
cd /root/app
|
||||
|
||||
# si no existe directorio de ambiente, se crea
|
||||
if [ ! -d ./libs ]; then
|
||||
python -m venv libs
|
||||
. ./libs/bin/activate
|
||||
pip install -r requirements.txt
|
||||
fi
|
||||
|
||||
# activar ambiente con dependencias
|
||||
. ./libs/bin/activate
|
||||
|
||||
if [ ! -d ./project ]; then
|
||||
django-admin startproject project
|
||||
fi
|
||||
|
||||
if [ ! -f .env ]; then
|
||||
cp .env.develop .env
|
||||
fi
|
||||
|
||||
# asignar nueva password a root
|
||||
if [ "$ROOTPASS" != "" ]; then
|
||||
echo "Cambiando la password de root..."
|
||||
echo -n "root:$ROOTPASS" | chpasswd
|
||||
unset ROOTPASS
|
||||
fi
|
||||
|
||||
# indicar a git carpeta segura
|
||||
git config --global --add safe.directory /root/app
|
||||
|
||||
# iniciar ssh
|
||||
sh /start.sh &
|
||||
|
||||
# iniciar servidor
|
||||
python /root/app/project/manage.py runserver 0.0.0.0:$PORT
|
||||
|
Loading…
Reference in New Issue