diff options
author | Matthew Lemon <y@yulqen.org> | 2024-05-28 15:15:44 +0100 |
---|---|---|
committer | Matthew Lemon <y@yulqen.org> | 2024-05-28 15:15:44 +0100 |
commit | 2037c6b87564772c7ac3f3ece3e4b2df5bc44cdc (patch) | |
tree | 222bb552655033468af47818a072096999cd03d9 /scripts/deploy.sh | |
parent | 2b4181aecadbbad988cd80f97ef71b42d47a3cb1 (diff) |
Should be a buildable Django container
Diffstat (limited to '')
-rwxr-xr-x | scripts/deploy.sh | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/scripts/deploy.sh b/scripts/deploy.sh new file mode 100755 index 0000000..b7ecf74 --- /dev/null +++ b/scripts/deploy.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +# Assign arguments to variables +IMAGE_NAME="pyblackbird" +TAG="latest" # Adjust tagging strategy as needed +DOCKER_REGISTRY="registry.gitlab.com/yulqen" # Docker registry URL + +SERVER_HOST="substracker-web" + +# SSH into server to pull the image, restart the container, and configure NGINX and Certbot +#ssh -i $SSH_KEY_PATH $SSH_USER@$SERVER_HOST << EOF +ssh $SERVER_HOST << EOF + +# Stop and remove the existing container if it exists +docker stop $IMAGE_NAME || true +docker rm $IMAGE_NAME || true +docker rmi $DOCKER_REGISTRY/$IMAGE_NAME:$TAG || true + +# run using the .env file for config settings +cd code/pyblackbird && docker run -d --rm --name pyblackbird --mount type=bind,src=/home/surge/code/pyblackbird/data,dst=/app/data --env-file .env -p 8080:8080 $DOCKER_REGISTRY/$IMAGE_NAME:$TAG + +EOF + +echo "Deployment complete." |