Created
May 25, 2016 19:43
-
-
Save jswny/d443c9af055d53229068b81014af825f to your computer and use it in GitHub Desktop.
Shell script to automatically deploy j1.io using Docker.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This file will automatically deploy j1.io using Docker to /var/www/j1.io | |
printf "Starting deployment...\n" | |
cd /var/www | |
printf "Cleaning up before starting...\n" | |
rm -rf j1.io | |
docker stop j1.io | |
docker rm j1.io | |
docker rmi jswny/j1.io | |
printf "Getting latest build from Git...\n" | |
git clone https://github.com/jswny/j1.io.git | |
# change this line to wherever your config directory resides | |
cp -R ~/config j1.io | |
cd ./j1.io | |
printf "Building new image...\n" | |
docker build -t jswny/j1.io . | |
printf "Running image...\n" | |
# Change this line if you want to configure a different public port for the container | |
docker run -p 80:3000 -d --name j1.io jswny/j1.io | |
printf "Container successfully deployed!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment