10 lines
635 B
Bash
Executable File
10 lines
635 B
Bash
Executable File
#!/bin/bash
|
|
|
|
if [[ $(docker container ls -a) =~ totpauth_api-[0-9]*-$DEPLOY_CONTEXT ]]; then
|
|
echo "totpauth_api_$DEPLOY_CONTEXT container exists"
|
|
echo ${BASH_REMATCH}
|
|
docker container rm -f ${BASH_REMATCH}
|
|
else
|
|
echo "totpauth_api container doesn't exist"
|
|
fi
|
|
docker run --detach --publish 127.0.0.1:$DEPLOY_PORT:8080 --name totpauth_api-$(date +%Y%m%d)-$DEPLOY_CONTEXT --restart always --volume ./conf/application-$DEPLOY_CONTEXT.yaml:/srv/conf/application.yaml --volume ./dist:/srv/dist --volume ./package.json:/srv/package.json --volume ./start_script.sh:/srv/start_script.sh -w /srv/ node:18 bash -c ./start_script.sh |