1
0
Fork 0
This commit is contained in:
Ilya Mukhortov 2023-09-20 15:51:18 +10:00
parent 7ec7fd5ff0
commit fc18ea3c76
3 changed files with 34 additions and 15 deletions

View File

@ -1,12 +1,6 @@
set -e
echo "readonly" | docker login docker.med-logic.ru --username readonly --password-stdin
docker pull docker.med-logic.ru/medicine-nginx:latest
docker pull docker.med-logic.ru/medicine-app:latest
docker pull docker.med-logic.ru/tfoms-patient:latest
NETWORK_NAME=medicine-network
if [ -z $(docker network ls --filter name=^${NETWORK_NAME}$ --format="{{ .Name }}") ] ; then
docker network create ${NETWORK_NAME} ;
@ -15,18 +9,10 @@ fi
cd /root/medicine-config/thirdparty-apps
docker-compose pull
docker-compose build
docker-compose up -d
cd /root/medicine-config/medicine-stack
docker-compose up -d
sleep 10
docker-compose exec postgres psql -c 'CREATE DATABASE medicine' --username=postgres
docker-compose exec postgres psql -c 'CREATE DATABASE tfoms_patient' --username=postgres
docker-compose exec postgres psql -d medicine -c "CREATE ROLE readonly; GRANT USAGE ON SCHEMA public TO readonly; GRANT SELECT ON ALL TABLES IN SCHEMA public TO readonly; ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readonly; CREATE USER readonly_user WITH PASSWORD 'readonly_password'; GRANT readonly TO readonly_user; ALTER ROLE readonly WITH LOGIN;" --username=postgres
cd /root/medicine-config/thirdparty-apps
docker-compose up -d
cd /root/medicine-config/tfoms-patient
docker-compose up -d
docker-compose run --rm app bash -c "(cd /app/tfoms && flask db upgrade)"

View File

@ -8,5 +8,6 @@ cd /root/medicine-config/medicine-stack
docker-compose exec postgres psql -c 'CREATE DATABASE medicine_remd' --username=postgres
cd /root/medicine-config/medicine-remd
docker-compose run --rm medicine-remd python manage.py migrate
docker-compose run --rm medicine-remd python manage.py post_install
docker-compose up -d

32
bash_scripts/install_old.sh Executable file
View File

@ -0,0 +1,32 @@
set -e
echo "readonly" | docker login docker.med-logic.ru --username readonly --password-stdin
docker pull docker.med-logic.ru/medicine-nginx:latest
docker pull docker.med-logic.ru/medicine-app:latest
docker pull docker.med-logic.ru/tfoms-patient:latest
NETWORK_NAME=medicine-network
if [ -z $(docker network ls --filter name=^${NETWORK_NAME}$ --format="{{ .Name }}") ] ; then
docker network create ${NETWORK_NAME} ;
fi
cd /root/medicine-config/thirdparty-apps
docker-compose pull
docker-compose build
cd /root/medicine-config/medicine-stack
docker-compose up -d
sleep 10
docker-compose exec postgres psql -c 'CREATE DATABASE medicine' --username=postgres
docker-compose exec postgres psql -c 'CREATE DATABASE tfoms_patient' --username=postgres
docker-compose exec postgres psql -d medicine -c "CREATE ROLE readonly; GRANT USAGE ON SCHEMA public TO readonly; GRANT SELECT ON ALL TABLES IN SCHEMA public TO readonly; ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readonly; CREATE USER readonly_user WITH PASSWORD 'readonly_password'; GRANT readonly TO readonly_user; ALTER ROLE readonly WITH LOGIN;" --username=postgres
cd /root/medicine-config/thirdparty-apps
docker-compose up -d
cd /root/medicine-config/tfoms-patient
docker-compose up -d
docker-compose run --rm app bash -c "(cd /app/tfoms && flask db upgrade)"