Mercurial > public > ssdt-docker
comparison prod/install-ipdp-db.sh @ 606:2aebef3e31bf
add ipdp install scripts
author | Justin Kleinknecht <justin.kleinknecht@mcoecn.org> |
---|---|
date | Tue, 01 Jul 2025 20:50:56 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
537:ad36483ba0c2 | 606:2aebef3e31bf |
---|---|
1 #!/bin/bash | |
2 # | |
3 # read required env variables | |
4 BASEDIR="$PWD" | |
5 source $BASEDIR/.env/ipdp-shared.properties | |
6 source $BASEDIR/.env/ipdp-db.properties | |
7 # | |
8 # docker login | |
9 echo "attempting to login to $artifactoryUrl" | |
10 docker login $artifactoryUrl -u $artifactoryUser -p $artifactoryPassword | |
11 # docker pull db image | |
12 echo "attempting to pull $artifactoryUrl/ipdp-db:$dbVersion" | |
13 docker pull $artifactoryUrl/ipdp-db:$dbVersion | |
14 # | |
15 # create employee self service specific docker network for $entityId | |
16 echo "attempting to create $entityId-ipdp-net docker network" | |
17 docker network create $entityId-ipdp-net | |
18 # docker run ipdp-db (data mounted as volume) connected to $entityId-ipdp-net docker network | |
19 echo "attempting to execute docker run command" | |
20 docker run --name $entityId-ipdp-db \ | |
21 --restart=unlipdp-stopped \ | |
22 --mount source=$entityId-ipdp-db,target=/var/lib/postgresql/data \ | |
23 --network $entityId-ipdp-net \ | |
24 -e POSTGRES_DB=ipdpdb \ | |
25 -e POSTGRES_PASSWORD=$dbPassword \ | |
26 -d $artifactUrl/ipdp-db:$dbVersion |