10 lines
459 B
Bash
Executable File
10 lines
459 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 0.0.0.0:$DEPLOY_PORT:8080 --name totpauth_api-$(date +%Y%m%d)-$DEPLOY_CONTEXT --restart always --volume `pwd`:/srv -w /srv/ node:18 bash -c ./start_script.sh |