Skip to content

Instantly share code, notes, and snippets.

@viggy28
Created May 11, 2021 05:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save viggy28/34c365fabc56a25a3f7c4aa1331d287f to your computer and use it in GitHub Desktop.
Save viggy28/34c365fabc56a25a3f7c4aa1331d287f to your computer and use it in GitHub Desktop.
#!/bin/bash
# stop the container
echo "stopping mydemoapp docker container..."
sudo docker stop mydemoapp
# remove the container
echo "removing mydemoapp docker container..."
sudo docker rm mydemoapp
# remove the directory
echo "removing directory..."
rm -rf /home/mydemoapp/mydemoapp
# clone the repository
. /home/mydemoapp/app.secret
echo "cloning repository..."
git clone https://admin:$DEPLOY_TOKEN@gitlab.com/invsto/mydemoapp.git /home/mydemoapp/mydemoapp
# building docker container
cd /home/mydemoapp/mydemoapp
sudo docker build -t mydemoapp:latest .
# start the container
echo "starting mydemoapp docker container..."
sudo docker run -it -p 80:80 --name mydemoapp --detach mydemoapp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment