fix install biometric

This commit is contained in:
Wilson Gomez 2023-08-22 10:36:26 -05:00
parent ae630b5332
commit 5bdcb0ff46
2 changed files with 36 additions and 20 deletions

View File

@ -9,7 +9,7 @@
# Fill this variables before run script #
#
domain=domain #
port=8001 #
port=8000 #
user=psk #
# #
#---------------------------------------------------------
@ -130,11 +130,13 @@ server {
error_log /var/log/nginx/${domain}_error.log;
# max upload size
#client_max_body_size 2048M; # adjust to taste
client_max_body_size 2048M; # adjust to taste
#location /static {
# alias /<path_to>/static; # your Django project's static files - amend as required
#}
error_page 497 301 =307 https://${domain}:${port}$request_uri;
# Finally, send all non-media requests.
location / {

View File

@ -3,15 +3,29 @@
#---------------------------------------------------------
# Fill this variables before run script #
#
domain=localhost #
port=8010 #
user=psk
db_name=DB_NAME #
read -p "ingresa el dominio donde se enuentra la base de datos tryton ej: cloudx.presik.com o localhost: " domain #
read -p "port api tryton ej 8010: " port_tryton
read -p "port api biometric ej 8010: " port_biometric
read -p "NODE ENV options 'development' for http or 'production' for https: " env #
read -p "Nombre de base de datos: " db_name #
# #
#---------------------------------------------------------
cd /home/$user
cd
if ! [ -x "$(command -v curl)" ]; then
sudo apt -y install curl
>&2
echo "curl is installed"
fi
if ! [ -x "$(command -v node)" ]; then
curl -sL https://deb.nodesource.com/setup_18.x | sudo bash -
sudo apt -y install nodejs
>&2
echo "node is installed"
fi
cd $HOME
mkdir biometric
cd biometric
git clone https://developer_presik@bitbucket.org/presik/app-bio.git
@ -20,7 +34,7 @@ sudo apt-get install libcairo2 libcairo2-dev libgirepository1.0.dev gir1.2-fprin
python3 -m venv venv
cd api-bio
/home/$user/biometric/venv/bin/pip3 install -r requirements.txt
$HOME/biometric/venv/bin/pip3 install -r requirements.txt
cd ..
cd app-bio
@ -29,12 +43,12 @@ cd app-bio
cat >.env <<EOF
REACT_APP_BIOMETRIC_API_HOST="127.0.0.1"
REACT_APP_BIOMETRIC_API_PORT="8010"
REACT_APP_TRYTON_API_HOST=$domain
REACT_APP_TRYTON_API_PORT="8010"
REACT_APP_DB=$db_name
REACT_APP_BIOMETRIC_API_PORT="$port_biometric"
REACT_APP_TRYTON_API_HOST="$domain"
REACT_APP_TRYTON_API_PORT="$port_tryton"
REACT_APP_DB="$db_name"
DISABLE_ESLINT_PLUGIN=true
NODE_ENV === 'development'
REACT_APP_ENV="$env"
EOF
npm install
@ -62,9 +76,9 @@ Description= Server Biometric
After=network.target
[Service]
User=$user
WorkingDirectory=/home/$user/biometric/api-bio
ExecStart=/home/$user/biometric/venv/bin/uvicorn main:app --reload --port 8010 --host 0.0.0.0
User=$USERNAME
WorkingDirectory=$HOME/biometric/api-bio
ExecStart=$HOME/biometric/venv/bin/python3 run.py
#ExecStop=
[Install]
@ -84,9 +98,9 @@ else
Description=App Biometric Web
[Service]
User=$user
Group=$user
WorkingDirectory=/home/$user/biometric/app-bio
User=$USERNAME
Group=$USERNAME
WorkingDirectory=$HOME/biometric/app-bio
ExecStart=npm run start
ExecStop=